Sort List
Uncontrolled node
Overview
Sort values or records by a selected property.
Create a sorted copy of a list in ascending or descending order. Sort values directly, or set a property path to sort records by one of their fields. The source order is not changed.
This node is evaluated when another node needs its output. It has no run or done event.
Inputs
| Input | Type | Description |
|---|---|---|
| list | List | The list to sort. Use consistent value types. |
| path | Text | Optional object-field path, such as score or customer.name. Configure this field in the node’s properties: a value connected directly to this socket is currently ignored. |
| Dynamic | Data | A configured path template such as {{sortField}} creates a corresponding input for choosing the field dynamically. |
Properties
| Setting | Type | Description |
|---|---|---|
| order | Choice | Ascending (ascending, default) or Descending (descending). |
Outputs
| Output | Type | Description |
|---|---|---|
| output | Data | Sorted list. An empty list or a non-list input currently returns { "error": "Input is not a list" }. |
Choosing the sort field
Leave the configured path empty to compare the items themselves. Set it to a dot-separated property path for objects. Use fields present on every item and keep their types consistent; missing or mixed-type values can give an unexpected order.
Numbers sort numerically. Text sorting is case-sensitive, not a locale-aware or natural-number sort. For example, the strings "10" and "2" do not sort like the numbers 10 and 2.
For a changing field, configure path as {{sortField}} and connect the field name to the resulting sortField input. Do not connect the field name directly to path.
Examples
With list: [3, 1, 4, 1], no path and ascending order, the result is [1, 1, 3, 4].
For records:
[
{ "name": "Alex", "score": 7 },
{ "name": "Sam", "score": 9 }
]
Configure path as score and order as Descending. The result is:
[
{ "name": "Sam", "score": 9 },
{ "name": "Alex", "score": 7 }
]
If the source may be empty, handle that case before using the result as a list.