Updated by Matheus Enrique Alves
Variables are places created to store values on the platform, allowing data to persist even after the completion of a flow.
To use a variable, the
@ must be placed and the typed expression will be replaced by the real value of the variable, as long as it is created properly.
Below, we will make a list of how to refer to all types of variables.
Contacts and contact fields
@contact: variables to save values directly linked to the contact. Below is a list of the most used sub-variables:
@contact.name: contact's full name;
@contact.first_name: contact's first name;
@contact.urns: list of contact's URNs. It can also be accessed through
@contact.uuid: contact's unique id;
@contact.created_on: date when the contact was created;
@contact.language: contact's preferred language;
@contact.channel: preferred contact channel name;
@contact.groups: groups which the contact participates;;
@contact.fields: Custom contact fields. To access, just use
Results and flows
@results: variables to saving values linked directly to the flow results. To access a result, just use
@results.result_name.Below is a list of the most used sub-variables:
@results.name.category: category / route to which that result belongs;
@results.name.value: exact result text value;
@results.name.extra: values in addition to text that a result may have, such as attachments or requisition information.
@input: values in addition to text that a result may have, such as attachments or requisition information.
@input.text: Text value inserted by the contact in his last interaction with the platform.
@input.attachments: Attachments inserted by the contact in their last interaction with the platform.
@child: allows referencing all child flow variables, that is, the flow that was called by the action card Enter a flow, within the parent flow. If you want to access a child flow result after its completion, for example, just use
@child.results.result_name. When using another Enter a flow chart, the
@childvalue is overwritten.
@parent: allows reference to all parent flow variables, that is, the flow that called the action card Enter a flow, within the child flow. If you want to access a parent flow result during the execution of the child flow, for example, just use
Global variables, or globals, are variables that can be accessed from any flow, at any time, but cannot be modified during a flow execution. They are widely used when we need to send the same information to several different flows, and then we need to modify this value in a practical way for all flows where it is inserted.
To create a global one, just go to your organization's general settings and scroll down to the bottom of the page, where you will find the tab for the globals.
After that, just click on Create Global, type the name of the global you want along with the value.
It will become accessible in any flow through the variable