JSON Array
The JSON Array node provides operations for manipulating JSON arrays. Use it to sort, filter, deduplicate, flatten, slice, and transform arrays within your workflow data.
Actions
| Action | Description |
|---|---|
jsonArray:sort | Sort array elements by a field |
jsonArray:filter | Filter array elements by a condition |
jsonArray:map | Transform each element using a mapping |
jsonArray:reduce | Reduce an array to a single value |
jsonArray:flatten | Flatten nested arrays |
jsonArray:unique | Remove duplicate elements |
jsonArray:slice | Extract a portion of the array |
jsonArray:reverse | Reverse the order of elements |
jsonArray:find | Find the first element matching a condition |
jsonArray:count | Count elements, optionally with a filter |
jsonArray:sort
Sorts array elements by a specified field.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array to sort |
field | string | Yes | Field name to sort by |
order | string | No | asc or desc. Defaults to asc |
jsonArray:filter
Returns elements that match the specified condition.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array to filter |
field | string | Yes | Field to evaluate |
operator | string | Yes | Comparison operator: equals, notEquals, greaterThan, lessThan, contains, startsWith, endsWith, isNull, isNotNull |
value | any | Conditional | Value to compare against |
jsonArray:map
Transforms each element by selecting, renaming, or computing fields.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array to transform |
mappings | array | Yes | Array of field mapping objects |
mappings[].from | string | Yes | Source field name |
mappings[].to | string | Yes | Target field name |
jsonArray:reduce
Reduces an array to a single value by applying an operation across all elements.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array to reduce |
field | string | Yes | Field to aggregate |
operation | string | Yes | Aggregation: sum, min, max, avg, concat |
jsonArray:flatten
Flattens nested arrays into a single-level array.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array with nested arrays |
depth | integer | No | Maximum depth to flatten. Defaults to 1. Use -1 for full flatten |
jsonArray:unique
Removes duplicate elements from an array.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array to deduplicate |
field | string | No | Field to use for uniqueness comparison. If omitted, compares entire elements |
jsonArray:slice
Extracts a portion of the array.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array to slice |
start | integer | Yes | Start index (zero-based) |
end | integer | No | End index (exclusive). If omitted, slices to the end |
jsonArray:reverse
Reverses the order of elements in an array.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array to reverse |
jsonArray:find
Returns the first element that matches the condition.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array to search |
field | string | Yes | Field to evaluate |
operator | string | Yes | Comparison operator |
value | any | Yes | Value to match |
jsonArray:count
Counts elements in the array, optionally filtered by a condition.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
input | array | Yes | Array to count |
field | string | No | Field to filter on |
operator | string | No | Comparison operator for filtering |
value | any | No | Value for the filter |
Connection
No connection required. This is a data transformation node.
Output
For reduce, the result is a single value. For find, the result is a single object (or null). For count, the result is an integer. For all other actions, the result is an array.