How it works
- Pass a list of text, numbers or dates and pick the order: A to Z (smallest first) or Z to A (largest first).
- For a list of dictionaries, set the advanced Sort by field.
- A list that mixes kinds, such as numbers and text, is refused with a clear message.
- It returns the sorted copy and its count.
Routines that use it
Biggest files first
Sort the results of List files by size, Z to A, and show the top one with Get list item.
Alphabetical menu
Sort names before offering them in Choose from a list.
Oldest backup
Sort backup dates A to Z and recycle the first with Delete to Recycle Bin.
Settings
| Setting | What it does |
|---|---|
| List | The list to sort: text, numbers or dates. |
| Order | A to Z (smallest first) or Z to A (largest first). |
| Byadvanced | For a list of dictionaries: sort by this field, such as name or size. |
Good to know
- All items must be the same kind; a mix of numbers and text can't be sorted.
Questions
- Can I sort files by size in KeyRoutines?
- Yes. Pass the list from List files and set Sort by to the size field.
- How do I sort largest first?
- Choose Z to A, which puts the largest numbers and latest dates first.