Configuration Reference
All properties and per-operation parameter details for Collection Operation.
Properties
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
operation | string enum | Yes | — | The operation to perform. One of: filter, map, reduce, sort, distinct, count, first, last, reverse. |
collection | string (expression) | array | Yes | — | The source array. Can be a BizFirst expression referencing a variable ({@ var.orders }), a literal inline array, or the name of a node output ({@ output.GetOrders.data }). |
expression | string (JS expression) | Depends | — | A JavaScript expression evaluated per element. The current element is available as item. Required for filter, map, reduce. Optional for count, first, last. |
field | string | Depends | — | Field name used by sort and distinct operations to specify which property to sort or deduplicate on. |
direction | string enum | No | asc | Sort direction for the sort operation. One of: asc (ascending) or desc (descending). |
initial_value | any | Depends | — | The starting accumulator value for the reduce operation. Required for reduce. Examples: 0 for sum, "" for string concatenation, [] for array building. |
Expression Context
The
item Variable
In filter, map, count, first, and last operations, the expression is evaluated once per element. The current element is bound to the item variable. For reduce, the expression receives both item (current element) and acc (current accumulator).
Per-Operation Parameter Requirements
| Operation | expression | field | direction | initial_value |
|---|---|---|---|---|
filter | Required (boolean expression) | — | — | — |
map | Required (transform expression) | — | — | — |
reduce | Required (acc + item expr) | — | — | Required |
sort | — | Required | Optional | — |
distinct | — | Optional (for objects) | — | — |
count | Optional (filter first) | — | — | — |
first | Optional (find condition) | — | — | — |
last | Optional (find condition) | — | — | — |
reverse | — | — | — | — |
Example Configurations
// Filter: keep only active orders
{
"operation": "filter",
"collection": "{@ var.orders }",
"expression": "item.status === 'active'"
}
// Map: extract just the IDs
{
"operation": "map",
"collection": "{@ var.orders }",
"expression": "item.orderId"
}
// Reduce: sum all totals
{
"operation": "reduce",
"collection": "{@ var.orders }",
"expression": "acc + item.total",
"initial_value": 0
}
// Sort: by price descending
{
"operation": "sort",
"collection": "{@ var.products }",
"field": "price",
"direction": "desc"
}
// Distinct: unique by email field
{
"operation": "distinct",
"collection": "{@ var.contacts }",
"field": "email"
}
Empty Collection Behaviour
If the resolved collection is null or an empty array, the node follows the success port with an empty result ([] for array operations, null for first/last, 0 for count/reduce with initial_value 0). The error port is only triggered if the expression itself throws.