Modifier
Modifiers can modify and transform data on the fly. They allow you to apply a JSONata or JavaScript expression to change the structure and value of an output before passing it to the next step in your flow.
A Modifier can use either JSONata or a JavaScript expression to perform transformations. By default, it is set to JSONata. You can switch between types at any time by right-clicking the modifier and selecting Jsonata or Expression.
When you switch the modifier type, any existing code within it will be deleted.
JSONata
JSONata is a lightweight query and transformation language designed for JSON data.
To refer to the value from the preceding output, use the
$sign.For JSONata functions, however, the previous value is automatically considered as an argument, eliminating the need to explicitly fill it into the brackets.
For a complete guide, refer to the official JSONata documentation.
Examples
1. Wrap a value in an object: This expression takes the incoming value ($) and wraps it inside a JSON object with a key named payload.
{ "payload": $ }2. Select a nested value: This expression selects the location value from a nested incoming object. If the input is an object like { "user": { "name": "John", "location": "Berlin" } }, this expression will output the string "Berlin".
user.locationVisual Examples



JavaScript Expressions
This allows you to use any standard JavaScript expression that evaluates to a new value.
The variable
xis reserved and always contains the value from the preceding output.For more information, refer to the MDN documentation for JavaScript Expressions and Operators.
Examples
1. Concatenate a string: This expression takes the incoming string (x) and adds a prefix to it.
2. Perform a conditional check: This ternary expression checks if the incoming number (x) is greater than 100 and returns a corresponding string.
Visual Examples

Patterns of common usage
Changing all objects within an array at once
For that the
mapfunction comes in handy. Say yourxrepresented data in the form:And you wanted to remove
cfrom every entry and add adproperty instead, you could write:This would result in the following output:
Implementing full Javascript, including variables While the modifier supports only Javascript expressions, you can work around this using the IIFE pattern
This pattern is useful if you need to do something more elaborate and need a temporary variable. In case of the
combinefunction this gets quickly useful.Computing with dates While the regulate
Dateobject from Javascript is available, we also provide support for the extra-ordinary Luxon library which provides theDateTimeobject. With that you can do things like:
Last updated