# Variables

## What are variables

Variables are placeholders for information that is part of your bot, user or conversation. Variables are defined by the platform, the skills that are installed in your bot, or by you as a flow builder. Variables hold information that can be used inside your conversations. For example, `Bot` is the variable that holds the title of your Bot, and `Purpose` holds the description. Both fields are maintained on the [Identity](https://manuals.dialox.ai/settings/app-settings/app-identity) within your bot's settings.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2F8y8hBOv697DMdTPxNM28%2Fimage.png?alt=media&#x26;token=27867840-8d89-4fd7-b53a-f1ae0a3aa438" alt=""><figcaption><p>Variables in Flows</p></figcaption></figure>

## Variables tab

The **Variables tab** shows the variables that can be used inside your flows. The platform variables and the built-in variables of your installed skills are displayed at the bottom. The variables that you defined yourself, called Custom variables, are displayed at the top.

### Platform and built-in variables

Depending on the skills installed in your bot, the list of built-in variables might differ. The following table describes the most commonly used ones:

| Label                 | Bubblescript        | Description                                                                                                                                                                                            |
| --------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Bot                   | bot.title           | Name of the Bot as given in the [Bot identity settings page](https://manuals.dialox.ai/settings/app-settings/app-identity).                                                                            |
| Bot language          | bot.locale          | The main language of the Bot as configured in the [Bot identity settings page](https://manuals.dialox.ai/settings/app-settings/app-identity).                                                          |
| Email                 | user.email          | The email address of the user                                                                                                                                                                          |
| First name            | user.first\_name    | The first name of the user                                                                                                                                                                             |
| Last name             | user.last\_name     | The last name of the user                                                                                                                                                                              |
| Language              | user.locale         | The language of the user, on the phone and WhatsApp channels this is derived from the country code in the phone number. On web channels it is derived from the web browser.                            |
| Last seen             | user.last\_seen     | The datetime when the user had their last conversation with this Smart App                                                                                                                             |
| Last message          | last\_message       | Last message of the user                                                                                                                                                                               |
| Phone                 | user.phone          | The phone number of the user in ISO 164 format, like +3112345678                                                                                                                                       |
| Purpose               | bot.purpose         | The description of the Bot as given in the [Bot identity settings](https://manuals.dialox.ai/settings/app-settings/app-identity)[ page](https://manuals.dialox.ai/settings/app-settings/app-identity). |
| Conversation language | conversation.locale | The language in which the current conversation is being held. If this Smart App supports the language of the user, it will initially be the same value as the Language variable.                       |

## Using variables in your flows

There are two ways of using variables inside your flows.

### Method 1 - Copy the variable to your clipboard

Click on one of the variables in the Variables tab to copy it to your clipboard. You can then paste the variable inside any of the compatible text fields of your Flow to use the selected variable.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FlAUq2rE5aUlxfffV8SJL%2Fimage.png?alt=media&#x26;token=805145cd-7eef-4bb3-a9aa-c78334875505" alt=""><figcaption><p>Using variables by clipboard</p></figcaption></figure>

### Method 2 - Select the variable with short key /

Type a `/` (forward slash) in the text field you want to use a variable and select the variable from the drop down.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FBMiMEngYWozvTi3IaxFp%2FScreenshot%20from%202025-09-15%2014-42-46.png?alt=media&#x26;token=c92872e2-9d3d-4f10-b010-4677a1a328a4" alt=""><figcaption><p>Using variables by short key /</p></figcaption></figure>

## Creating custom variables

Custom variables can be created implicitly while assigning them to a flow node or explicitly by adding a new variable in the **Variables tab**.

### Method 1 - Create a new variable in the Variables tab

New variables can be created using the **Add** button in the **Variables tab**.

<div><figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FTWaqe1Qp2Cn6ROurtvZH%2F0002.png?alt=media&#x26;token=65c25049-ab95-4414-aab8-3e69175c3222" alt=""><figcaption><p>Click Add</p></figcaption></figure> <figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FmtFYkZbbIekAYwX5qKOm%2F0001.webp?alt=media&#x26;token=e2617c54-9afb-4c1b-8f88-06abf9779383" alt=""><figcaption><p>Fill in the form</p></figcaption></figure></div>

The **Add** button will pop up a small form to define the variable details. The following details can be defined.

<table><thead><tr><th width="250">Property</th><th>Description</th><th>Explanation</th></tr></thead><tbody><tr><td>Label</td><td>Display name of the variable</td><td></td></tr><tr><td>Name</td><td>Technical name of the variable</td><td>This is the identifier of the variable used in the underlying bubblescript.</td></tr><tr><td>Type</td><td>Data type</td><td>To help the system understand what type of data can be stored in this variable. Choices are string, boolean, number, datetime, date.</td></tr><tr><td>Description</td><td>To explain the purpose of the variable</td><td></td></tr></tbody></table>

### Method 2 - Create a variable while assigning

You can also store the results of an Ask node by defining it directly in a node. For example, the Ask Open node allows you to ask an open question to the user. You can capture their response by defining a new variable in the **Assign to** field.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FgsYKOdmKVoSUCUErSXgS%2FScreenshot%20from%202025-09-15%2014-51-37.png?alt=media&#x26;token=74df6312-23fa-44d1-b8b4-7bd19afd0782" alt=""><figcaption><p>Defining by assigning a variable</p></figcaption></figure>

When a variable is created in this way, it will not have any of the other variable properties such as label, description and type. To add these later you can go to the **Variables** tab and click on the **Edit** button.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FmeyyEQO9W5LlzNrRixg3%2Fimage.png?alt=media&#x26;token=7053154a-5bea-49ac-bfa9-a5a788258cd2" alt=""><figcaption><p>Edit the Variable details</p></figcaption></figure>

## Native string interpolation

{% hint style="info" %}
Older skills are configured using native string interpolation using the elixir syntax. This still works for backwards compatibility reasons. Please migrate your flows to the new method whenever possible.
{% endhint %}

Data captured in variables can also be used in your flows using the native elixir string interpolation syntax:

`#{variable}`

In the following example the name field is captured using the **Ask Name** node and then the next step is a node type say which embeds the name in the text: "Nice to meet you #{name}".

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2F2ekaC9ed9onJo5zvMb3s%2Fimage.png?alt=media&#x26;token=faf09eec-a642-4191-86fa-8decc3b5dddb" alt=""><figcaption></figcaption></figure>

### Embedding user variables

Fields that are stored in the user object can be embedded by using the user object reference syntax. For instance embedding the name of the user in a text:

`#{user.first_name}`
