---
title: Use a value of an answer in other requests
project: TotalAPI
version: Latest
section: guides
language: en
license: 
url: https://totaljs.es/docs/totalapi/latest/guides/keep-values/
updated: 2026-12-02T15:40:16.062Z
---

# Use a value of an answer in other requests

> A request can take a value from its answer and keep it in a variable: the token after signing in, or the identifier of what it made.

## Keep the value

1. Open the tab **Checks** of the request that gets the value.
2. Under **Keep in variables**, press **+ Keep a value**.
3. On the left, write where the value is.
4. On the right, write the name of the variable, without braces.

Each time you send the request and an answer comes, the variable has the new value. The tab **Checks** of the answer shows it under **Kept in variables**.

## Say where the value is

| Write | To take |
| --- | --- |
| `token` | That value of the JSON |
| `value.token` | A value inside another |
| `items[0].id` | The `id` of the first one of a list |
| `header:x-token` | A header of the answer |

A value that is not in the answer changes nothing: the variable stays as it was.

## Where it is kept

The value goes to the environment that you are using. If the variable is there, it keeps being secret or not, as you left it. If it is not, TotalAPI adds it, and makes it secret when its name has `token`, `password`, `secret` or `key`.

> Any other new variable is written in the file of the collection. If the value is private, add the variable first and mark **Secret**.

## An example

1. The request **Sign in** keeps `value.token` in `token`.
2. The request **My orders** has `{{token}}` as its **Bearer token**.
3. Send the first, then the second. When the token ends, send the first again.

It works also when you [run the requests one after another](/totalapi/latest/guides/run/).
