Reusable Variables
Reusable variables let you save a data extraction once and apply it to multiple endpoint parameters. Instead of creating individual mappings for each use, you define a variable that captures where data comes from.
Input Variables
Input variables inject fixed or per-collection values into endpoint URLs and query parameters. They appear at the top of the Variables panel and are defined on the connector, not extracted from responses.
Types
| Type | Description |
|---|---|
| Static | A fixed value stored on the connector (e.g. a shared tenant slug, API version) |
| Runtime | No stored value — prompted when each collection starts |
Creating an Input Variable
- Open the Variables panel
- Click + Add input variable
- Choose Static or Runtime
- Set the variable name (used in
{{variable_name}}templates) - For Static: enter the fixed value
- For Runtime: optionally enter a test value — used only during connector building so real requests work. The test value is never published.
- Optionally set a display label (shown in collection start form for runtime variables)
- Optionally set auto-apply to parameter — automatically wires the variable to every endpoint that has a matching path or query parameter name
Using Input Variables
Reference the variable anywhere in a URL path or query parameter using {{variable_name}} syntax:
https://{{base_domain}}/api/v2/users
/orgs/{{org_id}}/repos
Variables are also supported in the Token Endpoint URL field, enabling connectors where the token endpoint varies per customer.
What Are Extracted Variables?
Extracted variables represent:
- A source endpoint (where data comes from)
- A JSON path (what data to extract)
- A default mode (iterate or first)
- Optionally, a filter condition (see Conditional Variables)
Once created, you can apply the variable to any parameter on any endpoint.
Variable Types
Traces supports three types of variables:
| Type | Description | Use Case |
|---|---|---|
| Standard | Extracts values from a single endpoint response | Most common — e.g., user IDs from a list endpoint |
| Paired | Combines outer/inner value sources into correlated pairs | Correlating related data — e.g., user IDs with their org memberships |
| Merged | Combines values from multiple variables into one | Aggregating IDs from multiple list endpoints |
See Paired Variables and Merged Variables for detailed guides.
Creating Variables
From the JSON Viewer
- Test an endpoint to see its response
- Click on a value in the JSON viewer
- Click Save as Variable in the selection popover
- Enter a name (e.g., "User IDs", "Channel Names")
- Choose default mode:
- Iterate: Target endpoint runs once per value
- First: Use only the first value
From the Variables Panel
- Open the Variables Panel (bottom of the right panel)
- Click + New Variable
- Select source endpoint
- Choose JSON path from response
- Name and configure the variable
Using Variables
Applying to Parameters
- Select an endpoint in the tree
- Find the parameter drop zone (path, query, or body)
- Click the Variable icon on the drop zone
- Select from available variables
- The mapping is created automatically
Applying via Drag and Drop
- Open the Variables Panel
- Drag a variable chip
- Drop onto any parameter drop zone
Variables Panel
The Variables Panel shows all saved variables:
| Column | Description |
|---|---|
| Name | Variable identifier |
| Source | Endpoint providing data |
| Path | JSON path being extracted |
| Mode | iterate or first |
| Used By | Count of endpoints using this variable |
Expanded Details
Click a variable to expand it and see:
- Which endpoints currently use this variable
- Extracted values preview
- Filter condition (if configured)
- For paired variables: outer/inner sources and pairing mode
- For merged variables: constituent variables
Panel Actions
- Edit (pencil): Modify variable settings
- Delete (trash): Remove variable (disconnects all mappings)
Variable vs Direct Mapping
| Aspect | Variable | Direct Mapping |
|---|---|---|
| Reuse | Apply to many endpoints | Single use |
| Editing | Update once, affects all | Edit each individually |
| Filters | Supports conditions | No filtering |
| Organization | Named and visible | Implicit |
Use variables when:
- Same data feeds multiple endpoints
- You need to filter array data
- You want clear documentation of data flow
Use direct mappings when:
- One-off parameter filling
- Quick testing
- Simple connector with few dependencies
Variable Modes
Iterate Mode
When applied to a parameter, the target endpoint runs once for each extracted value:
Variable: userIds (from users[*].id)
Values: ["u1", "u2", "u3"]
Target: GET /users/{userId}/posts
Runs 3 times:
/users/u1/posts
/users/u2/posts
/users/u3/posts
First Mode
Only the first value is used:
Variable: primaryOrg (from organizations[0].id)
Values: ["org1"]
Target: GET /orgs/{orgId}/settings
Runs 1 time:
/orgs/org1/settings
Best Practices
Naming Conventions
Use descriptive names that indicate:
- What data the variable contains
- Whether it's filtered (for conditional variables)
Good: ActiveChannelIds, PageTypeBlocks, UserEmails
Bad: var1, data, ids
Variable Organization
- Group related variables by source endpoint
- Delete unused variables to reduce clutter
- Use paired or merged variables for complex data flows instead of many individual variables
Mode Selection
- Default to iterate for array data that should all be processed
- Use first for lookups where any value works
- Consider API rate limits when iterating over large arrays
Troubleshooting
"Variable shows 0 values"
- Test the source endpoint first
- Verify JSON path matches response structure
- Check if filter condition is too restrictive
"Changes to variable don't apply"
- Variables are applied at test time
- Re-run dependent endpoint tests after modifying
- Check that the variable is actually used (not a direct mapping)
"Can't delete variable"
- Variables in use show a warning
- Remove mappings using the variable first, or confirm deletion
Related Documentation
- Paired Variables - Combining correlated value sources
- Merged Variables - Combining multiple variables into one
- Conditional Variables - Adding filter conditions
- Dependency Mapping - Direct mapping alternative