Contact us

Schedule a video callA 15-minute walkthrough of the dashboard with a manager Contact supportHelp with the platform and payments Send an emailCollaboration, partnerships and other proposals

Variables and conditions

A variable holds what the script has learned about the person. The Condition block splits the dialog by it, and conditional text swaps a piece of a message.

Create a variable

  1. Settings › Variables › Create.
    The “Variables” tab in the script settings
  2. Set the name, the type and the default value.
    The “Create variable” window: name, type and default value
Text
Any string: the person’s answer, a city, a name.
Number
Compared as a number: greater than, less than.
Yes/No
A flag: “reminded”, “agreed”.

The name starts with a letter, followed by letters, digits and _, and must be unique within the script. You can also create a variable on the fly with the Create variable button in the Set variable and Condition blocks.

Save a value

The Set variable block: choose a variable and a method.

Input
You set the value. For text it’s a string, and placeholders work in it: [message.incoming.last] saves the person’s last reply. For a number it’s a number; for Yes/No it’s a switch.
AI Paid
Describe the task — AI reads and answers with a value of the right type. If it can’t answer in that type, the variable stays empty.
The Set variable block in “Input” mode: “reminded” = Yes
The block in “AI” mode: a task that uses the last reply

Insert a variable into text

A variable goes into a message, a notification or an AI task as [variable.name]. Type [variable. and the editor shows which ones exist.

Variable suggestions after typing “[variable.”

Audience list variables are inserted the same way — no need to create them in the script. If a name exists in both places, the first non-empty value in this order is used:

  1. the value saved in this dialog by a Set variable block;
  2. the person’s value in the audience list;
  3. the default value in the script;
  4. the default value in the audience list.

If nothing is found, an empty string goes in. If there’s no variable with that name anywhere, [variable.name] stays in the text, brackets and all.

Placeholders inside a variable

A variable’s value can itself contain placeholders — they’re filled in when the message is sent. For example, if the audience list has the intro My name is [account.name], each person sees the name of the account that’s writing to them.

Text that came from Telegram — the person’s messages, profile and channel descriptions — isn’t expanded this way: brackets are stripped from it. A variable that refers back to itself through a chain isn’t expanded any further.

Split on a condition

  1. Add a Condition block and click Add rule.
  2. Choose what to compare: a script variable or dialog data — the person’s name, the last reply, how many hours of silence.
    The “Variable” list in a condition rule
  3. Choose the comparison and the value. You can add several rules: All means every rule must match, Any means one is enough.
    The “Declined?” condition: two rules and “Any” selected
  4. Connect the outputs: the upper green one is used when the condition is met, the lower red one when it isn’t.
Audience list variables aren’t in the list. To compare one, create a script variable with the same name: each person’s value from the list is picked up automatically.

The comparisons for text, numbers and Yes/No and the dialog data you can use are in the reference.

Show a piece of text on a condition

To avoid adding blocks for a single phrase, write the condition right in the text:

[if user.name]Good afternoon, [user.name]![else]Good afternoon![/if]

SyntaxMeaning
[if user.name]…[/if]Show if filled in
[if not user.name]…[/if]Show if not filled in
[if variable.city = London]…[else]…[/if]Show one thing or the other
[if variable.locations > 1 and variable.city = London]…[/if]Both conditions must hold; or means one is enough

Both script variables and audience list variables work in text. Type [if and the editor suggests variables and comparisons and adds the closing [/if] for you. You can’t nest [if] tags or mix and and or in one tag.

The editor underlines tag errors in red — a missing pair, an extra [else], a comparison it can’t read.

An unclosed [if] tag underlined in red

While there’s an error, the script won’t be ready to launch: the text would reach the person as is, brackets and all.

Same via the AI assistant

AI assistant “Create an ‘interest’ variable and have AI decide after each reply: yes, no or unclear”