Variables or properties or entities are data storage entities. Variables are a way to store data or the user input in a format to reuse that detail in the chatbot conversation or to store the information.
Variables are helpful when you need to personalize the conversation by saving the user name in a variable for using it during the conversation or if you want to store user details and pass them on to external systems or generate reports.
You can save user details or inputs in a variable for getting user insights as well.
Generally, these are of the below kinds:
- System - These are generally global contexts, not under the direct control of a brand. For eg, the current date, and time.
- Global Session - These are brand-level variables. They are defined by the brand and have the same value across all end users. For example, counter, brand name, etc.
- Local Session - These variables are global for a customer/end user. For example, customer name, email address, etc.
- Local or Session-based - These are session-based variables, whose scope can restrict to a particular session. For eg, after the 24-hour session on WhatsApp, the local variables can restart again
- Event-based - These are external variables whose scope is customer based but can be true for a segment of customers. For example, the channel of the message received from the customer, customer message, type of events, autoresponders, etc. These can be viewed or used but should not be edited.
- Name (Unique identifier)
- Data Type (the kind of data it can store, for eg, text, number)
- Dummy Value (Some initial value for eg, 0 for a number or another constant)
There are two data types that can be stored:
Below are the steps to use variables in the chatbot journey building:
- Open the Variable Management screen. (you can open the Variable Management screen by clicking on Manage Variables)
- Give a name to the variable, eg - user_phone, user_email
- Select the data type from the dropdown on the manage variable screen.
- Provide a default value (it is optional) and click save.
- Any special character can’t be added to the variable name except _ and -
- Duplicate name variables can’t be added.
- System Variable and Session Variable Naming can’t be the same.
Variables can be added by clicking on Manage Variable Button on the Journey Builder screen. Any Variable added can't be deleted, only the default value can be edited for a variable. To add a variable, a Name, and Data type are to be added and then click on the save button.
Updated 3 months ago