Sort
Puts a list in order.
Fields
| Field | Type | Required | What it does |
|---|---|---|---|
items | jsonata | yes | Expression producing the list. |
by | jsonata | The key to order by, worked out per item, for example total. Without it the values themselves are ordered. | |
direction | one of: asc, desc | Up or down. Defaults to up. |
Output
items (in order), total, direction
Notes
Numbers compare as numbers, text the way a person expects ("9" before "10"), and items with no key go last either way. Items with the same key keep the order they arrived in.