Variables
Use a Variables step to assign named values for use in subsequent steps.
Beta feature
This feature is currently in beta, and should be considered ‘under development’. Learn about the automations beta.Overview
A Variables step assigns one or more named values using JSONata expressions. Once assigned, variables are available to all subsequent steps in the workflow, referenced directly as $variableName.
Configuration
Each Variables step contains one or more variable definitions, listed as key/value rows:
- The key field (placeholder key) is the variable name used to reference the value later, for example,
fullName - The value field (placeholder value) is a JSONata expression whose result is assigned to the variable, for example,
$trigger.current.FirstName & ' ' & $trigger.current.LastNameto buildfullName
Click + Add to add another variable definition. Variables are evaluated in order, top to bottom. A variable defined earlier in the same step can be referenced by a later definition in the same step.
Tip
Clicking Use variable → switches the entire set of variable definitions to a single raw JSONata expression instead of individual key/value rows. Click ← Build manually to switch back to the row-based editor.Referencing variables in later steps
Once a Variables step has run, any step that follows can reference its values using $variableName.
Example: reference a variable named fullName in a subsequent action argument:
$fullName
When to use a Variables step
- Avoid repetition: compute a value once and reference it in multiple places, rather than duplicating a complex expression.
- Improve readability: give a meaningful name to an expression that would otherwise be hard to scan in an action argument field.
- Reshape data: transform or combine values from the trigger or previous actions into the exact shape needed by a downstream step.
- Conditional logic: pre-compute a value used in a Choice condition to keep the condition expression simple.
Expression examples
| Goal | Expression |
|---|---|
| Combine first and last name | $trigger.current.FirstName & ' ' & $trigger.current.LastName |
| Extract a nested value from a previous action | $getRecord.result.data.AccountId |
| Build a default value with a fallback | $trigger.current.Description != null ? $trigger.current.Description : 'No description provided' |
| Format a date from a trigger field | $fromMillis($toMillis($trigger.current.StartDate), '[D01] [MNn] [Y]') |
| Combine two previous variables | $firstName & ', ' & $jobType |
See also
- JSONata expressions: expression syntax and built-in functions
- Choice: use variables in branching conditions
- Actions: pass variables as action arguments
- Triggers: the source variables exposed by each trigger type
Feedback
Was this page helpful?