> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/strategies/tokens/using-variable-tokens-within-the-chatbot.md).

# Using Variable Tokens within the Chatbot

## Creating a variable

Variables in a chatbot are used to temporarily store data, allowing that information to be accessed and reused later within the flow. However, this data remains available only during the chatbot execution, meaning it is not persisted after the interaction ends.

To save an answer in a variable, you must first create the variable in the field **"Save answer in a variable"**, available in the block **"Send Question"**.

<figure><img src="/files/2f4dc4677a29baf93a370a204878ffc68aaf7de0" alt=""><figcaption><p><em>Saving the lead's answer in a variable.</em></p></figcaption></figure>

## Using the variable token - Send Message Block

The token follows the format `{var=Pet Name}`, with braces, the word **`var`** and the variable name after the equals sign (`=`). At the time the message is sent, the token will be replaced by the value filled in by the lead.

<figure><img src="/files/ee6ccde07614546080d83724b5a66488d0bffd10" alt=""><figcaption><p><em>Token inside the 'Send Message' block.</em></p></figcaption></figure>

## Using the variable token - Send Webhook action

The variable token can be used in various actions, such as in the **"Send Webhook"** action, to send data to an external platform.

In the example below, a webhook is being sent containing the lead's registered email and the pet's name, which was saved through the variable.

<figure><img src="/files/5214a3dd359bbedfdaf54ba156eb664458256ce8" alt=""><figcaption><p><em>Token inside the 'Send Webhook' action.</em></p></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sprinthub.com/en/strategies/tokens/using-variable-tokens-within-the-chatbot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
