When to use
- Simplify complex objects from SAP or NetSuite into flat structures
- Extract specific fields from nested API responses
- Format dates from ISO format to custom formats
- Combine multiple fields into computed values
- Filter and reshape arrays of records
- Map fields between different data structures
Input parameters
The JSON object or array to transform. Can reference variables from previous nodes or DataSlots, or contain static JSON. Reference its top-level keys directly in the Query.
A JSONata expression that transforms or queries the input data. Reference the input’s top-level fields directly (for example,
Account.Order). The result of the expression becomes the node’s output.Optional output field type used to format the result. Options:
Date/Time (requires a Format for the output date) and Phone.Output
The Transform node outputs the result of the JSONata expression applied to the input data. The result is returned directly — there is no wrapper key.Adding to your workflow
Add the node
Click Add Node in the workflow canvas, select Transform from the list of available nodes, then position it in your workflow.
Configure input data
Provide the JSON object or array to transform. Reference data from previous nodes using variable syntax or provide static JSON.
Write JSONata query
Create your transformation expression using JSONata syntax, referencing the input’s top-level fields directly. The result of the expression becomes the node output.
JSONata reference
Data Access
Data Access
| Syntax | Description | Example |
|---|---|---|
| Field Access | Access object properties | vendor.name, address.city |
| Array Access | Access array elements | items[0], records[-1] |
| Conditional Access | Default values for missing fields | vendor.phone ? vendor.phone : "N/A" |
| Wildcard | Access all elements | *.name, items.*.id |
String Functions
String Functions
| Function | Description | Example |
|---|---|---|
$uppercase() | Convert to uppercase | $uppercase(vendor.name) |
$lowercase() | Convert to lowercase | $lowercase(status) |
$substring() | Extract substring | $substring(id, 0, 5) |
$trim() | Remove whitespace | $trim(description) |
$replace() | Replace text | $replace(phone, "-", "") |
& | Concatenate strings | FirstName & " " & LastName |
Date Functions
Date Functions
| Function | Description | Example |
|---|---|---|
$now() | Current timestamp | $now() |
$toMillis() | Convert to milliseconds | $toMillis(created_at) |
$fromMillis() | Format from milliseconds | $fromMillis($toMillis(date), "[Y0001]-[M01]-[D01]") |
Array Functions
Array Functions
| Function | Description | Example |
|---|---|---|
$map() | Transform each element | $map(items, function($v){ $v.name }) |
$filter() | Filter elements | $filter(items, function($v){ $v.status = "active" }) |
$reduce() | Reduce to single value | $reduce(items, function($acc, $v){ $acc + $v.amount }, 0) |
$count() | Count elements | $count(records) |
$sum() | Sum numeric values | $sum(items.price) |
$average() | Calculate average | $average(scores) |
Operators
Operators
| Operator | Description | Example |
|---|---|---|
+, -, *, / | Arithmetic | price * quantity |
=, != | Equality | status = "active" |
>, <, >=, <= | Comparison | amount > 1000 |
and, or | Logical | status = "active" and amount > 100 |
? | Conditional | score > 80 ? "high" : "low" |
Examples
Flatten SAP Vendor Response
Flatten SAP Vendor Response
Transform nested SAP vendor data into a flat structure for internal processing.Input:Sample Input Data:Query:Output:
Map NetSuite Records to Name-Value Pairs
Map NetSuite Records to Name-Value Pairs
Convert NetSuite records into name-value pairs for Config DataSource dropdowns.Input:Query:Output:
Filter and Transform Order Array
Filter and Transform Order Array
Filter active orders and extract specific fields with formatted dates.Input:Sample Input Data:Query:Output:
Create Nested Structure from Flat Data
Create Nested Structure from Flat Data
Restructure flat Tipalti payment data into a nested format for reporting.Input:Sample Input Data:Query:Output:
Calculate Aggregates from Array
Calculate Aggregates from Array
Calculate summary statistics from an array of transaction records.Input:Query:Output:
Troubleshooting
Empty or Null Output
Empty or Null Output
Problem: Transform node returns empty response
| Cause | Solution |
|---|---|
| Empty Query | Provide a JSONata expression in the Query field. |
| Field not found | Reference the input’s top-level keys exactly as they appear in the Input JSON (e.g. Account.Order). |
| Input field missing | Verify the Input field contains valid JSON data. |
JSONata Syntax Errors
JSONata Syntax Errors
Problem: Node returns syntax error instead of transformed data
| Cause | Solution |
|---|---|
| Missing quotes or brackets | Check for balanced quotes and brackets |
| Invalid function name | Verify function names are correct (case-sensitive) |
| Wrong operator | Use = for equality, & for concatenation |
| Test in playground | Use jsonata.org to validate syntax |
Missing Field References
Missing Field References
Problem: Query returns null for expected values
| Cause | Solution |
|---|---|
| Field name mismatch | Field names are case-sensitive, verify exact names |
| Wrong path | Use the full path from the input’s top-level key (e.g. vendor.name if the input has a vendor object) |
| Field does not exist | Add conditional: field ? field : "default" |
| Use Debug Node | Inspect actual input structure before Transform |
Date Formatting Issues
Date Formatting Issues
Problem: Date functions produce unexpected results
| Cause | Solution |
|---|---|
| Invalid date format | Ensure input dates are valid ISO format |
| Missing toMillis | Always convert to milliseconds first: $toMillis(date) |
| Wrong format string | Use [Y0001]-[M01]-[D01] for YYYY-MM-DD |
Array Processing Errors
Array Processing Errors
Problem: Array functions fail or return unexpected results
| Cause | Solution |
|---|---|
| Input not an array | Verify input is actually an array with $type() |
| Function syntax error | Check function signature matches JSONata spec |
| Empty array | Add check: $count(array) > 0 ? $map(...) : [] |
Next steps
Custom Code node
Process complex data with JavaScript or Python.
Data Mapper node
Apply simple field name transformations.
Rule node
Add conditional transformation logic.
Loop node
Apply transformations across arrays.