> For the complete documentation index, see [llms.txt](https://docs.formsort.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.formsort.com/core-concepts/formsort-quickstart-guides/template-your-variables.md).

# Template your variables

Refer back to answers already given in your flow.

Sometimes you want to refer back to answers already collected in your flow and display those answers to a responder. A common use case of this is calling the responder by their first name, or reminding them of a choice they had selected in a previous question. This is called **templating variables**.

{% embed url="<https://www.loom.com/share/b476fa30487142e796c27874ae5d5918>" %}

### **How to do it in the Studio**

* In this flow, I asked a **Text question** to ask the pet’s name, and I named the variable `pets_name`

![](https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2F5JXyQXdZdnkfGi3xxIXl%2Ftemplate1.png?alt=media\&token=1448c04e-ce31-4b24-96e9-008ec658cdd6)

* In my next two steps, I insert the answer variable `pets_name` from that question in double brackets.

![](https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FPwBFskah5fherE7LBvvk%2Ftemplate2.png?alt=media\&token=242134b1-5297-4519-9024-175c06429da0)

You can always see a list of the variables you have available to you in the side bar under variables:

![](https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2FazkLQkXtkutRPimZ2zHz%2F6mrbco.gif?alt=media\&token=780ec5ec-8d93-47b8-aa7b-1fd8dde98fe2)

### How it looks to a responder

![](https://1036686854-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MJPnL__mOdr_mLZ8nwf%2Fuploads%2F1d6J6rIEz4KAGFPj9H2e%2F6md2gk.gif?alt=media\&token=eff05659-1fe0-4af6-9b36-1e09d4f73915)

### Other resources

If you need to reformat the variables you collected, please refer to [Templating formatting functions.](/variable-templating.md#template-formatting-functions)

Use templated variables in [redirect URLs](/variable-templating.md#redirect-urls) and [image URLs](/variable-templating.md#inserting-answer-values-into-content).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.formsort.com/core-concepts/formsort-quickstart-guides/template-your-variables.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
