List Sort
Runs on: Shared — pure logic, runs on the Community backend or inside a chatbox overlay.
The List Sort node sorts a list and outputs the sorted copy. The original list passed in is never modified, so you can reuse it elsewhere in the same flow.
Primitive lists (strings, numbers, booleans) sort by value directly. Lists of custom or built-in objects sort by a chosen Sort By field — or wire the field input to choose it at runtime. Numbers sort numerically, text sorts alphabetically (case-insensitive, natural order — so item2 comes before item10), and booleans put false before true.
The Order labels adapt to what's being sorted: A → Z / Z → A for text, Low → High / High → Low for numbers, False First / True First for booleans, or Ascending / Descending otherwise.
Inputs
| Name | Type | Description |
|---|---|---|
list | list | The list to sort. |
field | string | Optional. Wire this to choose the sort field at runtime instead of picking it in the node. |
Outputs
| Name | Type | Description |
|---|---|---|
result | list | The sorted copy of the list, same item type as the input. |
Configuration
- Order: ascending or descending, labeled for what you're sorting.
- Sort By: required for lists of custom or built-in objects. An object list with no field selected passes through unsorted.
Example
Sort a leaderboard list by score (High → Low), then feed the result into List Take (first 5) to build the entries for a !top chat command. For a "then by" tie-break, chain a second List Sort on the tie-break field — the sort is stable, so ties keep their order from the first sort.