Skip to main content
Nintex Community Menu Bar

Populate dynamically a calculated value by using a JavaScript function call

  • October 23, 2017
  • 2 replies
  • 463 views

This post intends to demonstrate how a JavaScript/JQuery function can populate a calculated value control dynamically within a Nintex Form. Accessing data by using REST API Service makes dynamic content compulsory.

 

Here is the form view that shows unpopulated calculated value controls as following.

 

 

In order to resolve this issue, I have decided to force calculated values to be recalculated by JavaScript code.To accomplish this, we need to setup following steps.

  1. Define a textbox with the name of 'hiddenField' and set « Store Client ID in Javascript variable » to Yes and give the value of « Client ID Javascript variable name » as 'hiddenFieldPageID'.
  2. Then all our calculated values formula should be included with a reference to the textbox.
  3. In our calculated values, add a reference as a parameter that does not be used in our Javascript method.
  4. Ensure the formula is set to getLabel("lblSecondLang1",hiddenField).
  5. You will be able to force a calculated value to recalculate by calling these following lines of JavaScript code.

            var hiddenTextBox = NWF$("#" + hiddenFieldPageID);
            NWF.FormFiller.Functions.ProcessOnChange(hiddenTextBox);

 

The calculated value settings as shown below.

 

 

If you noticed, I have added the 'hiddenField' control into the fuction as a parameter, which causes the calculated value is triggered when the control has been updated. Finally, calling of JavaScript function ProcessOnChange refreshes the controls' value again.

 

 

calculated value control‌ dynamic population‌ resize at runtime

Translate
Did this topic help you find an answer to your question?

Forum|alt.badge.img+9
  • Scholar
  • October 23, 2017

Thanks a lot Mustafa !

This blog will help to create multilingual forms !

Translate

Forum|alt.badge.img+12
  • January 26, 2018

 NWF.FormFiller.Functions.ProcessOnChange();   ------> just what I was looking for   Thank you!

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings