Variable Management
UA | US | RU
|
---|
If you use information in the tunnel that changes periodically (date, price, etc.), then in order not to go through tunnel blocks each time updating the information, use variables. Create a variable, give it a name and value, and paste its name into the message. The name of the variable will be replaced by its value at the time the message is sent to the client.
В этой инструкции:
Variable types
There are 4 types of variables: Single Value, Array of Unique Values, Chat Template and Link.
A single value can only contain one value (one key = one value);
An array of unique values can contain an array of values (one key = value1;value2;value3...). This type can be used to send each client a unique value: unique invitation links, access codes, promotional codes;
A chat template contains text that you can simply add to a message on the chats page;
Link - designed to store part of a link. Can be inserted into the URL after the domain.
How to create a variable category?
Variables are divided into categories. Before you can create a new variable, at least one variable category must be created.
To add a new category, go to Settings --> Content --> Variable Management and click the Add New Category button:
If desired, you can give a name to the category of variables. By default, the category is named New category. To change the name, click on the category name, and in the window that opens, enter the required name in the corresponding “Name” field at the top of the window, after entering, click on the "Save" button :
How to create a variable?
After at least one category has been created, it will be possible to create your own variable. To do this, go to the created category and click on the Add new variable block:
The next steps will depend on the type of variable you want to create:
Creating a Variable of Type "Single Value"
Give the variable a name, for example "Day". The variable name must consist of only one word and do not contain Cyrillic characters (Latin alphabet and numbers can be used). The case of letters is taken into account, so if you gave the variable the name “Day”, and then want to use the variable “day” (with a small letter) in the message, the value will not be sent, since these are different variables for the system;
Select variable type - Single value;
Enter the contents of the variable, for example - Monday. The character limit in the variable content is 255.
Click the Create button.The variable receives one constant value, which can be used an infinite number of times and which will be sent to subscribers when called through the variable name.
Creating a variable of the "Array of unique values" type
Give the variable a name, for example "color". The variable name must consist of only one word and do not contain Cyrillic characters (Latin alphabet and numbers can be used). Letter case is sensitive. Therefore, if you gave the variable name “color”, and then want to use the variable “Color” (with a capital letter) in the message, the value will not be sent, since these are different variables for the system;
Select the variable type - an array of unique values;
Select a separator, for example, ";" (semicolon);
Variable values can be set manually (Data source: text) or by loading from a file (Data source: file). You can load from any text file, but the values in the file must be separated by the selected delimiter.
When you select “text”, enter the values in the field below using the selected separator: green; red; blue. As a result, we get 3 values of one variable, in our case “color”, separated by “semicolon”:Click the Create button;
In a message to clients (in a tunnel block, in a chat, in a message template), enter the variable name in curly brackets (in our case {color}) and send the message. Don't forget that letters are case sensitive:
When sending a message to 3 subscribers, each of them will receive a unique variable value, starting from the end. The first subscriber in the message will receive the third value of the {color} variable - “blue”, the second “red” and the third “green”. That is, the values of the variable will be sent sequentially, starting with the last one. You can use more than 3 values for a variable - there is no limit on the number of values. When the variable's values run out, the variable simply won't be sent. This type of variable can be used to send unique invitation links to an event, access codes, and promotional codes.
You can add values to a variable after it has been saved. It is currently impossible to view the entire list of variable values, but you can see their number (how many are left unused) in the item “Elements left”, “Content”:
Creating a variable of type "Chat Template"
Creating this variable type is the same as creating a variable of the Single Value type (see above), only the variable type must be selected Chat Template. We remind you that the variable name must consist of only one word and not contain Cyrillic characters (you can use Latin and numbers), and the character limit in the variable content is 255.
To use a variable, you need to click on the arrow to the left of the message entry field in the chat with the client (1). You will see a list of variables of this type that you have (2). Click on one of them (3), and its contents (text) will be copied into the message input field (4), from where it can be sent to the client. When you hover over a variable, a tooltip will appear with the value of the variable (5).
Only Chat Template variables can use the new system variable {me}, which contains the name of the person in your company who is sending the message. More information about the variables in our system here.
Creating a variable of type "link"
Creating this variable type is the same as creating a variable of the Single Value type (see above), only the variable type must be selected Link. You need to insert the address into the contents of the variable, starting after the domain. For example, in https://leeloo.ai the domain is leeloo.ai. If we want to insert a button into a message that, when clicked, will open a website, then we can do it as follows, using a variable:
The {dashboard} variable contains part of the link, starting after the domain. This type of variable cannot be inserted entirely into a link insertion line in a button menu of the Link type.
Thus, you can simplify working with links by using variables of the Link type.