> 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

How to create variables and use tokens to transfer data between blocks and actions.

## Creating a variable

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

To save a response in a variable, it is first necessary to create the variable in the field **"Save response in a variable"**, available in the block **"Send Question"**.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FhWcte6j882WFYKwir7Mz%2F1.png?alt=media&amp;token=19290d13-1c37-4780-82cb-c57dd8427cb4" alt=""><figcaption><p><em>Saving the lead's response in a variable.</em></p></figcaption></figure>

## Using a 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 (`=`). When the message is sent, the token will be replaced by the variable filled in by the lead.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FCWAoYa634YWvlG7CzShv%2F2.png?alt=media&amp;token=17e18995-4c20-410c-90ed-05ad311d7d25" alt=""><figcaption><p><em>Token inside the 'Send Message' block.</em></p></figcaption></figure>

## Using a variable token - Send Webhook action

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

In the case 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="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2F4EYt6waxB8M4mTK1AZNa%2F3.png?alt=media&amp;token=a588e3ab-b938-430e-9994-2fae21ffc2d2" 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.
