Variables can be used for capturing information, displaying dynamic content, and processing data in your chatbot.

How to store data in variables

You can store data in variables using the Store answer in variable or a similar option that’s available for certain blocks in the builder. This option appears in the block editor.

Let’s take the Text input block as an example. This block allows users to enter text. To store the user’s response in a variable, click the dropdown below the Store answer in variable option and select a variable.

Store answer in variable option in Text Input block

How to display variables in messages

You can display variables in messages using the {variableName} syntax. The variable name should be enclosed in curly braces.

As an example, let’s you have a variable called first_name and you want to greet the user by their name. Here’s how to do it:

  1. Add a Text output block to your chatbot.
  2. Click the block to open the editor.
  3. Type Hello, {first_name}! in the message field.
Display variable in message in Text Output block
  1. When the chatbot displays this block, it will replace {first_name} with the value stored by the variable.
Display variable in message

Note that the values stored are on a per-conversation basis. This means that the value of a variable is unique to each conversation and is not shared across different conversations.