Use an expression when you need to combine, calculate, compare, filter, or transform data.
Applaud expressions use the JSONata expression language.
Start with @
When a field accepts workflow data, type @ to open the variable picker.
Select the value you need.
For example, to pass an employee ID to another action, select:
$.inputs.employeeId
Combine values
Use an expression when you need to combine two or more values.
For example:
$.inputs.firstName & ' ' & $.inputs.lastName
This combines the first name, a space, and the last name.
If:
firstName = Alex
lastName = Smith
the result is:
Alex Smith
The ' ' is a literal space. The quotes tell the expression to treat it as text.
You can also combine a variable with fixed text:
'Employee: ' & $.inputs.employeeId
Calculate a value
Use arithmetic when you need to calculate a result.
For example:
$.inputs.daysRequested * 24
If daysRequested is 2, the result is 48.
Common arithmetic operators include:
| Operator | Description |
| + | Add |
| - | Subtract |
| * | Multiply |
| / | Divide |
Compare values
Use a comparison when you need to evaluate workflow data.
For example:
$.inputs.employeeType = 'Manager'
The expression returns true when the employee type is Manager.
Comparison operators include:
| Operator | Description |
| = | Equal to |
| != | Not equal to |
| > | Greater than |
| < | Less than |
| >= | Greater than or equal to |
| <= | Less than or equal to |
This is commonly useful in Condition actions.
Check whether a value exists
Use $exists() to check whether a value is available.
For example:
$exists($.ManagerApproval.status)
This returns true when the value exists.
This is useful when a workflow can follow different paths depending on whether an earlier action returned a value.
Work with lists
Use expressions when you need to work with a collection of values.
For example, use $count() to find the number of items in an array:
$count($.items)
Inside a Process List action, use:
$.item
to refer to the current item.
You can also use functions such as $filter() and $map() when you need to select or transform items in a collection.
Transform data
Use expressions in a Transform action when you need to reshape workflow data.
Common scenarios include:
- Creating a new object
- Renaming or restructuring properties
- Combining values
- Formatting data
- Preparing data for a tool or integration
- Extracting values from a response
Use @ to select the source values, then use an expression when you need to change how those values are structured or calculated.
Use expressions in agent tools
Agent Tool fx fields support expressions.
Use the variable picker to select workflow data, then add an expression when you need to combine, calculate, or transform the value.
For example:
$.inputs.firstName & ' ' & $.inputs.lastName
could provide a combined employee name to a tool.
Use values in agent instructions
Agent instructions use value substitution rather than a raw expression.
For example:
{{$.inputs.employeeName}}
inserts the value of employeeName into the instruction.
Use values in agent tool fields
Agent Tool value fields use value substitution.
For example:
{employeeName}
Use this when you need to pass an existing value.
If you need to calculate or transform the value first, use the Agent Tool fx field instead.
Test your expression
Always test an expression with representative data before using it in a production workflow or Agent Tool.
Check that:
- The referenced variables exist.
- The expression returns the expected value.
- Empty or missing values behave as expected.
- Lists contain the data you expect.
- The resulting value is in the format required by the next action or tool.
If an expression doesn't work, start with the simplest version and add complexity one step at a time.
Use AI to help write expressions
If you know what you want an expression to do but aren't sure how to write it, AI can help.
For example, you could ask:
Combine the employee's first and last name with a space between them.
AI could suggest:
$.inputs.firstName & ' ' & $.inputs.lastName
Always review and test an AI-generated expression before using it in a production workflow.
Next steps
- For a complete list of supported operators and functions, see Expressions reference.
- For a list of available workflow variables and their paths, see Workflow variables reference.