+7 495 255 06 20
Log In Free trial
Select Language
December 16, 11:00 AM

Blocking WhatsApp: how to reduce the risks?

Join our webinar to learn how to avoid losing contact with your clients!
Participate for free

A variable is a data storage to which we assign a name. And then we fill this storage with data and can use it, for example, to address a client by name in a bot.

Functions of variables and constants

Local, system, and global variables and constants are available in the constructor. Local, global, and constants can be created and modified manually, system variables cannot.

Systemic

Data in this variable appears at the moment of receiving a message from the client. System variables contain information about the dialogue:

System variables of date and time can be used separately from the client's message. If there is no message from the client, then the present date and time of the UTC +3 zone are taken, if there is a message, then it is taken from the time zone of your company.

Local

The value of this variable is unique for each dialogue. For example, if the bot has two dialogues simultaneously, changing a local variable in one dialogue will not affect the value of the same variable in the other dialog.

A local variable can be created and changed. Here's how to do it:

1. Go to the Bot Editor;

2. Click "Variables" in the right corner;

3. Click on or on an existing variable;

4. Select the data type;

5. Enter a name and value (you can save with an empty value);

6. Click "Save".

Global

The value of the global variable is the same for all dialogs. It can be created and changed. The global variable is, for example, the line or messenger in which the bot is currently communicating.

Here's how to create it:

1. Go to the Script Editor;

2. Click "Variables" in the corner on the right;

3. Click on or on existing variable;

4. Select the type of variable;

5. Select the data type;

6. Enter a name and value;

7. Click “Save”.


Constant

A constant is a value that remains unchanged during program execution. Its properties are the same as the global one, but it cannot be changed during the dialog.

Important! Constants are saved for the entire company.

They are not tied to a specific bot and are available in all company scenarios.

Using variables in text

In the editor, you can use variables in the message text. A variable is denoted by double brackets {{var}} and the value from the variable is substituted in its place. Any existing variable can be used as a variable.

The use of variables is available in the following blocks:

The list of blocks that support variables will be enlarged. We are actively working on it.

If a local or system variable is selected, but the value is not available, nothing will be inserted.

Video tutorial