Toggle menu

helper.getFieldValue(fieldName [,pageInstance])

Used to get the value of a field.

On a repeating page, if the function is called on a repeating page (which also has the field you are querying), pageInstance will default to the current instance. 

If the field is on a repeating page that has more than one instance saved to the session data, you must supply the page instance.

Executed

Client-side and Server-side.

Arguments

ArgumentTypeDescription
fieldNameString, requiredName of the field to get the value of
pageInstanceInteger, optionalUsed with repeating pages.

The instance (zero-based) of the page the field is on that you'd like to get the value of. Defaults to the current page instance if called on the page that holds the field. If you call this function from elsewhere on your form and the page instance is not supplied, it will return an empty string

Returns

String.

Example

In this example the value of one field is fetched in a default function:

function (helper, defaultValue, currentValue) {
  var theValue = helper.getFieldValue('FIELD4');
  return theValue;
}

On a repeating page with more than one instance, the pageInstance must be supplied:

function (helper, defaultValue, currentValue) {
  var theValue = helper.getFieldValue('FIELD4', 1);
  return theValue;
}

Last modified on September 13, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon