Intelligent Agent Core User Guide

Please email support@awaken.io for omissions or errors.
×
Menu

System and Workflow Variables

 
System and Workflow Variables are used to store temporary data that is available throughout the Workflow, usually for the purposes of displaying information to an agent, collating data, or acting as a "flag" to control the agent's path through a Workflow. All System and Workflow Variables are prefixed by var_, and when they are used and referenced in a Workflow then they are wrapped in square brackets in the same manner as Fields.
 
Variables come in two varieties:
  • System Variables are built in to Intelligent Agent, and are either populated automatically on record pop or throughout the Workflow, or are dependent on a specific control/feature being used.
  • Workflow Variables are user-defined, and can be added or removed at will by the designer to support the Workflow process.
 
Data stored in Variables is automatically deleted after the record is completed, so any data that is held solely in a Variable must be written to a Field (commonly a Hidden) if you wish to store its value for later Reporting purposes.
 
In this example, Variables are used to display an appropriate and dynamic greeting in a Text Label at the start of a Workflow, customising both the time-of-day greeting and agent's name:
 
 
 

System Variables

System Variables provide access to a wide range of system information useful for Workflow design or Reporting purposes, or can have their values set to control behaviour within Intelligent Agent. Probably the most commonly used example of a System Variable is [var_csAgentName], which is often used in labels on the greeting Page of a Workflow:
 
 
When the Workflow is run, the first and last name of the agent running the Workflow will be substituted in place of [var_csAgentName] in the label.
 
 
Details of all System Variables are held in the System Variable List.
 
 

Workflow Variables

Unlike System Variables which exist automatically for all Workflows, Workflow Variables are created by the designer and exist independently in different Workflow Versions.
 
Workflow Variables can either be created by clicking the Variables button at the top-right corner of the Designer window:
 
 
 
Or by clicking the Edit Variables button in the right-hand tray of any Code Editor or Text Editor:
 
 
 
Once the button has been clicked, the Variables modal is then opened:
 
 
 
Workflow Variables can then be imported or created by clicking the appropriate buttons at the top of the Variable list.
 
Importing Workflow Variables
Upon clicking the Import button, an instance of the Import Wizard is launched, with the final step being to choose the columns that will define the Variables' names, default values, and descriptions.
 
Creating Workflow Variables
Upon clicking the Add button, a modal will pop up where you can enter the Variable name. Note that all Variables are automatically prefixed with var_ so there is no need to type this part again. Variables' names can only contain letters, numbers, and underscores.
 
 
 
When happy with the Variable's name, click the Add button. The created Variable will be added to the list and selected, and additional information such as a default value or description can then be added if desired:
 
 
 

Comparing Variables and Fields

System and Workflow Variables share some similarities, but also have some fundamental differences.
 
Variables
Fields
Accessible on any Page in the Workflow.
Only accessible by JavaScript code on Pages that the Field is actually present.
Can never be directly manipulated by an agent, only ever through code.
Many Fields can be directly viewed or set by an agent.
Data is cleared from the Intelligent Agent database as soon as the Workflow run is completed.
Data is saved to the Intelligent Agent database.
Have their name wrapped in square brackets whenever referenced in code.
Can have their value displayed in a Text Label, or used in the configuration of other Fields.