Toggle menu

Form Variable Blocks

Variables hold values not visible to the users of your form. They are used to store data, useful for holding information returned from calls to other services, and can pass information between fields on your form.

Creating Variables

Create Variables
 

These blocks let you create a variable and set its value. You can change the name of the variable by changing the "name" text in the images above. The block lets you plug in another block that will set the value of the variable.

The basic block creates a "non persistent" variable. It will only be available on the current page of the form. The more advanced block is only available server-side and lets you set the scope of the variable, which is what you'll need if you want to share the variable's value between form pages. Scopes are explained in the .setVariable article.

Getting Variable Values

getVariable
 

This block gets the value of a variable. You'll only be able to fetch the value of a variable that's available in your current scope, that is, if you are working browser-side in a field handler, you won't be able to access any variables that are set to only be available server-side.

getOptionVariableDisplayValue
 

This block is designed to work with variables created by the list-type fields (drop-downs, radio groups etc) and the Form Variable - Lookup field. Supply the key you'd like to look up the display value for, and the name of the variable that holds the option data. See .getOptionVariableDisplayValue for more information.

User Profile Blocks

User Profile Block
 

The default settings of these blocks assume you are using the "User Profile - Load" field to load a profile into a variable called USERPROFILE (you can change the name of this in the block).

You can then select a property from the list of those in your site's user profile form. Clicking "TITLE" in the screenshot above would open the following list.

User Profile Property Select
 

iCM knows the properties present in the user profile definition your site uses and loads them all for you.

Last modified on 07 August 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon