Portal Community

Properties

PropertyTypeRequiredDefaultDescription
operationstring enumYesThe operation to perform. One of: filter, map, reduce, sort, distinct, count, first, last, reverse.
collectionstring (expression) | arrayYesThe 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 }).
expressionstring (JS expression)DependsA JavaScript expression evaluated per element. The current element is available as item. Required for filter, map, reduce. Optional for count, first, last.
fieldstringDependsField name used by sort and distinct operations to specify which property to sort or deduplicate on.
directionstring enumNoascSort direction for the sort operation. One of: asc (ascending) or desc (descending).
initial_valueanyDependsThe 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

Operationexpressionfielddirectioninitial_value
filterRequired (boolean expression)
mapRequired (transform expression)
reduceRequired (acc + item expr)Required
sortRequiredOptional
distinctOptional (for objects)
countOptional (filter first)
firstOptional (find condition)
lastOptional (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.