Skip to main content

Iterator: Sort

Order a list by a comparable key derived per element. The sub-graph runs once per element and emits a Number or String on the auto-created Iterator::Collect's key connector. The original elements are then reordered by those keys.

Mixed types order numbers before strings. Missing keys always sort last.

Example
Input (ascending): [{name: "B", n: 2}, {name: "A", n: 1}]
Body: key = el.n
Output: [{name: "A", n: 1}, {name: "B", n: 2}]

Parameters

Ascending

Sort ascending when enabled (default), descending when disabled.

Input

ArrayREQUIRED
List to sort (Array or JSON array).
Value

Optional value injected into every iteration as value on the entry node.

Output

Result
The reordered list.