Variables
The Variables page is where you have an overview of all your variables.
Variables are used to store any information the bot knows about a user. This can be their preferred language, or the channel they're using, but also information coming from external data sources like, for example, an API.
All variables used in a single conversation are stored in what is called a user session.

Create a variable
To create a variable from the Variables page:
Click on Create variable at the top right corner of the screen.

A window pops up. Fill in the Name, Default value and Description.

Click on Create variable.
Set a variable as sensitive
Chatlayer allows you to make sure that some variables are processed differently. This is useful when the conversation between a bot and a user contains sensitive information, such as the user's bank account number or anything GDPR-sensitive.
To define a variable as sensitive:
Create a variable or edit it using the Edit button.
Toggle on the Sensitive switch if you don't want this variable to be saved in the conversation history.
Click on Create variable.

Operations on variables
You can perfom operations on your variables.
Increment
If you want to incrementally increase the value of a variable, you can use the following steps:
Define a variable, for example
variableName, and give it a numeric value such as0At the point in the flow where you want to increment the value of
variableName, enter variableName as the variable and{variableName|increment}as the value
This method will increase the value of counter by 1 each time, for example when a specific block is passed or a button is clicked.
Change the case
Variables and values are case-sensitive.
For example, capitalVariable will be regarded as a separate variable fromCapitalVariable.
The same goes for values. If you check in a Condition block if a value for variableX is equal to valueY it will not be triggered if the value for variableX is equal to valuey
You can transform a value from upper case to lower case and vice versa by adding these modifiers to the value name:
Last updated
Was this helpful?