Variables and Constants in Chat Bots. Using Variables in LEADTEX
How to use different variable types in bots. User variables, global variables, and constants in chat bots
Data auto-substitution in chat bots is done through a system of variables and constants that allow personalizing communication and saving user information. Constants are built-in platform values, and variables are created to store user data.
User Variables for Data Collection
User variables are created to save information entered by the user during dialogue. In the data collection block, specify the variable name where the entered text is saved. To output the saved value, use the format {{$variable_name}}.
Variables are especially useful when creating feedback forms, applications, and questionnaires. The user fills in fields sequentially, and in the final block sees a summary of all entered data for verification before submission.
Global Variables and System Functions
Global variables are created in advance in Lists → Variables and contain permanent information used in different parts of the bot. These can be long texts, instructions, contact details.
To output the saved value, use the format {{variable_name}}.
The platform also provides system functions for working with data:
Auto-substitution and Variables
🎁 Free course on chat bot and mini-app development for all users with an active PRO subscription is already available on LEADTEX.
10 detailed lessons from A to Z.
Start learning right now — Start learning.