Variables and Expressions
Description
Variables enable value reuse across steps, while expressions compute data at runtime.
Motivation
Using variables keeps flows concise and simplifies passing IDs or tokens between steps.
Example
{
"vars": {
"token": "XXXX",
"collection": "uuid | prepend \"test-\""
}
}
Advanced Example
{
"vars": {
"host": "https://api.example.com",
"auth": "basic {{username}}:{{password}}"
},
"steps": [
{ "title": "List users", "method": "GET", "url": "{{host}}/users", "basic_auth": "{{auth}}" }
]
}
Questions & Answers
Q: Can expressions reference previous responses?
A: Yes. Use response.bodyJson
or other fields.
Comments
Store authentication tokens as variables to keep credentials centralized.
Other Uses
Combine expressions with the uuid
helper to generate unique IDs during tests.