Working with Variables

Variables can be used in multiple locations in a Studio flow to collect data points that will be used to make routing decisions.

10131013

Each component may expose “step variables” or data points from which the variables can be created when clicking on the dropdown and then on Create variable:

These variables can later be used to initialize or update some flow variables.

12421242

For example, the ​ Incoming Call component exposes 7 data points (contact details, source, and dialed phone numbers).

Another example is the ​Standard IVR​ component, which collects the keys pressed by the caller and populates the "selection" variable; it also populates the “exit_name” variable, whose value retrieves the name of the exit assigned to the selected key press.

These variables can then be used in other components.

How to write the name of a new variable:
• Do not use spaces. You can use an underscore and numbers instead.
• Write all letters in lowercase.
• Do not use accents, apostrophes, or other special characters.
• Add an underscore before the number, if you are using letters and numbers to name a context variable.

Example: case_1

When used in a text field, the syntax to reference a variable is:

%{current_flow.variable_name}

Using the example above, the syntax would be:

%{current_flow.case_1}

For example, you can use a variable in the Play Audio component to play a customized greeting message.

593593

The variable can be initialized from the initial component (Incoming Call) or via a data dip in your CRM system.

📘

Note

Please keep in mind that an underscore should be placed before the number in case you are using letters and numbers to name a variable that will later need to be referenced (in a query, for example).

Additional Resources: