Skip to main content
Nintex Community Menu Bar

Nintex Forms and Javascript - Form Variables

  • April 29, 2016
  • 4 replies
  • 192 views

Forum|alt.badge.img+7

Hi guys,

I am struggling with accessing the value of a form value from Javascript.

How can I do this?

Note: I am not talking about the value of an input control - here I am aware about the "Store client ID in Javascript variable".

Regards

Leif

4 replies

Forum|alt.badge.img+11
  • Nintex Partner
  • April 29, 2016

Hi Leif,

never worked with form variables before, so I don't know if you can access them directly via javascript.

But you can use a workaround for this:

  • Create "Calculated Value" field on your form and give it a unique css class (used "calculatedValue" here)
  • Insert your form variable as the "Formula" of this field
  • Use following JS code to get the value of this variable:

var myFormVariable = (NWF$('.calculatedValue label').text());

Now you have a JS variable called "myFormVariable" with the value of your form variable. But there may be easier ways to achieve this.

Regards

Philipp


Forum|alt.badge.img+17
  • Nintex Partner
  • December 23, 2016

‌ did this provide what you needed?


Forum|alt.badge.img+7

Hi Andrew,

Yep - I just marked the answer as correct. Great that you seem to be cleaning up in the forums :-D

Regards

Leif


Forum|alt.badge.img+2
  • October 30, 2018

Sorry, I am having trouble doing this, can you help me a little please.

I want to retrieve the value of the ID for an item that already exist on my list. I am doing that with a lookup in a calculated value. So far so good.

Second step is to use that value, which is just a number because it is the id of an item, in my form to build a hyperlink. The purpose of the hyperlink is to take the user from display mode into edit mode because information regarding the client he's looking for has already been input and must only be edited not repeated.

The problem is there because although I have the calculated value I cannot seem to access the value of it.

Example: if the id I'm retrieving is 5 y want mi url to be:

http://www.something.com/sites/lists/.../EditForm.aspx?ID={calculatedValue} <-- this is not happening because I cannot reference the calculated value from the formula section in Nintex forms. Any ideas on how to do this ????