Sort List
Put a list in order by the whole item or by a field such as score or created_at, comparing as text, numbers or dates, ascending or descending.
The Sort List node puts the items of a list in order. Sort the whole items, or sort by a field inside each item, such as score or created_at. You choose whether the values compare as text, numbers or dates, and whether the order is ascending or descending. The node is free.
When to use it
- Order scraped posts by likes, highest first, and keep the top three with Selector.
- Order feed items by date, newest first.
- Put a list of names in alphabetical order.
Quick start
Add the node
Press Tab on the canvas and choose Automate › Lists & Batching › Sort List.
Connect a list
Wire a list into the List input, for example from Web Scrape, List, Split Text or Filter List.
Choose how to sort
Open the settings panel. Choose Sort by field, Sort type and Direction.
Run it
The Sorted output carries the list in its new order. After a run, the panel previews the first items.
Inputs and outputs
| Input or output | Accepts or sends | What it does |
|---|---|---|
| List | A list of text or JSON items | The list to sort. |
| Sorted | A list | The same items in the new order. |
Settings
| Setting | What it does |
|---|---|
| Sort by field | What to compare. (whole item), the default, compares the full items. Choose a field detected from the upstream data, or Custom path… to type a dot path such as score or created_at. Each item is read as JSON when the path matches it. |
| Sort type | How to compare. Auto (detect), the default, tries Number, then Date, then Text. Choose Text, Number or Date for a fixed comparison. |
| Direction | Ascending, the default, or Descending. Items with a missing or invalid value always appear last, in both directions. |
Credits
Sort List is free.
Tips
- Top N items. Follow Sort List with a Selector in Range mode from
1toN. - Fix the type for repeatable runs. Auto (detect) decides from the values it receives. Choose Text, Number or Date when every run must sort the same way.
- Remove repeats too. Use Remove Duplicates before or after sorting to drop repeated items.
Frequently asked questions
Related
Selector
Filter List
Remove Duplicates
List
Lists and batching
Last updated on
Filter List
Keep only the list items that match your conditions, such as a field that contains a word or a date since the last run. Combine rules with AND or OR.
Remove Duplicates
Remove repeated items from a list and keep the first copy of each. Compare whole items or one field, such as id or url, in scraped or merged lists.