Toggle menu

helper.getVariable(name [, defaultValue])

Used to get the value of a helper variable.

A helper variable is used to store data within the form helper. Variables are saved with a scope (see .setVariable) which defines how they behave and where they can be accessed.

If multiple forms are rendered on the same page, they can have independent variables with the same name.


Client-side and server-side.


nameString, requiredName of the variable to get
defaultValueString, optionalA default value if the variable cannot be accessed, or has no value


The value of the variable, undefined if the variable doesn't exist, or the default value if supplied.


In this example the value of FIELD4 is being updated with the value of a variable called myVariable.

function (helper) {
    helper.setFieldValue('FIELD4', helper.getVariable('myVariable'));

Last modified on 13 September 2023

Share this page

Facebook icon Twitter icon email icon


print icon