> For the complete documentation index, see [llms.txt](https://docs.testmace.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.testmace.com/master/variables/user-variables.md).

# User-Defined Variables

The Variables section is a key-value storage for storing and reusing some data. It is often used for removing code duplicates and improving readability: the greetingUrl variable says more than just the line <https://next.json-generator.com/api/json/get/EJvQVEVGL> for sure.

The variables mechanism is very well integrated to all application parts and has several features:

* You can use strings, objects, arrays, and links to other variables as values.
* Variables are defined for each node and are inherited from parent nodes.
* Variables values can refer to other variables.
* [Default variables](/master/variables/variables.md) names start with $.

### Using Variables

You can use variables in any string parameters of the node - URLs, headers names, authorization tokens, etc. To do that, use the `${variableName}` syntax, where `variableName` is a link to the variable. Here are some examples:

* `${id}`
* `${$dynamicVar.id}`
* `${$response.body.name}`

It's possible to combine strings and links to other variables in the node parameters fields. For instance, you can use  `http://${host}/posts/${$dynamicVar.id}` as an URL.&#x20;

To access an array element, that is stored in a variable, you can use the `${variableName[index]}` syntax. For example, to access the third response entity id, you'll write `${$response.body[2].id}`. Note that it the index is zero-based.

Autocompletion works for variables:

![Variables autocompletion](/files/-LgbNeBxeiKn0jQ0n6-X)

Variable value highlighting works as well:

![Variable value highlighting](/files/-LgbO0UDKSouje5vnu0f)

There is the Variables button in every node interface, that opens the variables dialog. This is how the button looks like:

![The button to open the variables dialog](/files/-LgXRS7WppaA8EhJwsVI)

The button looks the same for all node types. You'll learn more about how to work with variables in the next sections.
