# Data you can insert

You can insert three kinds of data: the contact's own data, the contact's variables and the bot's global variables.

## Contact data

Written without a `$` sign: `{{ first_name }}`, `{{ phone }}`.

| Syntax | What gets inserted |
|---|---|
| `{{ name }}` | The contact's full name, as in the messenger or as saved by the bot |
| `{{ first_name }}` | The first word of the name |
| `{{ last_name }}` | The second word of the name |
| `{{ phone }}` | Phone number |
| `{{ email }}` | Email |
| `{{ address }}` | Address |
| `{{ username }}` | Username in the messenger |
| `{{ id }}` | Contact number in Watbot |
| `{{ bot_id }}` | Bot number |
| `{{ created_at }}` | When the contact first messaged the bot, as `2026-10-02 14:30:00` (UTC) |
| `{{ start_message }}` | The first message the contact sent to the bot |
| `{{ telegram_id }}` | Telegram user ID |
| `{{ max_id }}` | MAX user ID |
| `{{ amocrm_lead_id }}`, `{{ amocrm_contact_id }}` | amoCRM lead and contact IDs |
| `{{ bitrix_lead_id }}`, `{{ bitrix_deal_id }}`, `{{ bitrix_contact_id }}` | Bitrix24 lead, deal and contact IDs |

If the contact doesn't have that data — for example, no phone number — the insertion is replaced with an empty spot.

> [!NOTE]
> Some blocks have data of their own. For example, the new referral notification text supports `{{ name }}` (the invited contact's name) and `{{ level }}` (the referral level), and the "Distribution by groups" block supports `{{ name_list }}` and `{{ group_number }}`. They are described in those blocks' settings.

## Contact variables

Variables hold the contact's answers and anything the bot saved along the scenario. They are written with a `$` sign before the name:

```
You chose {{ $city }}.
```

If the contact doesn't have that variable, the insertion is replaced with an empty spot.

### If a variable name contains spaces

After the `$` sign, the bot reads the name only up to the first space. So a variable whose name contains a space can't be written with `$`: the bot can't tell where the name ends.

For such names there is the `var` function. Put the name in quotes, exactly as the variable is named in the bot:

```
{{ var("Client name") }}, thanks for your request!
```

How to write it:

1. Copy the variable name from the bot — uppercase and lowercase letters, spaces and symbols must match.
2. Put the name in quotes: `"Client name"`.
3. Wrap it in `var( )`: `{{ var("Client name") }}`.

| Variable in the bot | How to insert it |
|---|---|
| `city` | `{{ $city }}` |
| `Client name` | `{{ var("Client name") }}` |
| `Appointment date` | `{{ var("Appointment date") }}` |
| `Order total, USD` | `{{ var("Order total, USD") }}` |

`var` also works in [expressions](https://support.watbot.org/chatbots/templates/expressions), like any other value:

```
{{ upper(var("Client name")) }}, you pay ${{ var("Order total, USD") * 0.9 }}
```

> [!TIP]
> The easiest option is to name variables without spaces: `client_name`, `appointment_date`. Then the short form is enough: `{{ $client_name }}`.

> [!NOTE]
> If your scenarios already insert names with spaces using `$` outside expressions, those insertions keep working. In new texts, use `var`.

## Global variables

Global variables are set in the bot settings and are the same for every contact: an exchange rate, an office address, a payment link. They are written without `$`, exactly as named in the settings:

```
Our address: {{ office_address }}
```

### If a global variable name contains spaces or brackets

Use the `global` function — the name in quotes, exactly as in the bot settings:

```
Today's rate: {{ global("Rate (USD)") }}
```

Inside expressions, a global variable is always read with `global`, even if its name has no spaces:

```
Total in dollars: {{ round($total / global("Rate (USD)"), 2) }}
```

If contact data and a global variable have the same name, the contact data is inserted.

> [!WARNING]
> A global variable's value is shown as is — templates inside the value are not processed. If the value says `Hello, {{ $Name }}`, the contact sees exactly that text. Write such text directly in the block.

## Values are text

All data and variables are stored as text. In expressions, text that looks like a number is treated as a number: if `$quantity` holds `3`, the expression `{{ $quantity * 2 }}` gives `6`. Text that doesn't look like a number can't be calculated — that insertion is replaced with an empty spot, and the reason appears in the preview.
