# Sorting a list by column

Source: https://codeherder.com/docs/sorting-lists/

Click a column header to sort a list by it, the shared ordering rules, which pages and columns sort, and what a sort means on a list still loading rows.

Most list pages in the web app let you order rows by certain columns, not just the order they arrived in.

## Sorting a column

Click a sortable column header to sort the list by that column. Click it again to flip between ascending and descending. An arrow next to the header name shows which column is active and which way it’s sorted; every other header stays plain until you click it. Not every column sorts — the table below names the ones that do on each page.

Each column starts in whichever direction is most useful for it. A name or title column starts ascending (A to Z). A count, cost, or past-date column starts with the highest or newest value first. A column holding a future date starts with the soonest first — that’s why **Next run** on Task schedules opens with the run that fires next, rather than the one furthest away.

Sorting is a display choice, not a filter — it changes the order rows appear in, never which rows show. There’s no un-sort button: clicking another header sorts by that column instead. To get the list’s own default order back, drop the sort from the page’s web address — strip the query string and reload, or open the page fresh from the sidebar.

## How rows are ordered

Every sortable column uses the same rules, so “alphabetical” and “highest first” mean the same thing everywhere in the app:

- Text sorts without case sensitivity — “apple” and “Apple” land next to each other.
- A number inside text sorts numerically, not letter by letter — “Item 2” comes before “Item 10”, not after “Item 1”.
- A blank value always sorts last, in both directions, so an empty date or unset field never gets in the way of the rows that actually have one.

## Which pages sort, and by what

| Page | Sortable columns |
| --- | --- |
| [Tasks](https://codeherder.com/docs/tracking-work/#the-web-app-tasks-view) | Title, Priority, Created |
| Devices | Device, Sessions, Version, Last metrics |
| Devices (your account) | Device, Owner, Sessions, Version, Last metrics |
| [Agents](https://codeherder.com/docs/stage-staffing/) | Name, Last used, Operator, Role |
| Members | Name, Role, Email |
| Teams | Name, Created |
| [Connecting repositories](https://codeherder.com/docs/repositories/) | Name, Created |
| [Sessions](https://codeherder.com/docs/following-a-live-session/) | Agent, Device, Cost |
| [Blockers](https://codeherder.com/docs/blockers/) | Task, Filed by, Created |
| Task schedules | Name, Last run, Next run |
| Skills | Skill, Version |
| Wiki directory | Page, Folder, Updated |
| [Understanding costs](https://codeherder.com/docs/costs/) — Model routing table | Stage, Actual, Savings, Turns |
| Settings ▸ Workflows | Name, Stages |
| Settings ▸ Stage library | Label, Owner, Version |
| Settings ▸ Variables | Key, Scope, Updated |
| Settings ▸ Webhooks | URL, Last delivery |

A page not on this list doesn’t offer column sorting yet — that includes every panel nested inside a task’s, a device’s, or a member’s own detail page, and the ranked breakdown tables above the Model routing table on the Understanding costs page (their row order **is** the ranking, so there’s nothing to sort).

## The paged-list caveat

Tasks is the only page that sorts the full result set on the server, so its sort always reflects every matching task, however many there are. Every other page on the list above sorts only the rows it has already loaded into your browser. If a list keeps loading more rows as you scroll, sort it first, then keep scrolling to the bottom before you trust what’s at the top — an unloaded row can’t take part in the sort yet.

On Tasks, a parent task and its children still nest the way they always do (see [Finding and tracking your work](https://codeherder.com/docs/tracking-work/#list-view)); sorting orders the top-level tasks among themselves, and each parent’s own children among themselves, rather than flattening the hierarchy away.

Column sorting is a web app feature. The `ch` list commands have no sort option, so a list you print from the command line comes back in its own default order. The one exception is the team workload report, which takes its own `--sort` — see [Monitoring your agents](https://codeherder.com/docs/monitoring-agents/) for that.

## The link carries it

Like the page’s filters, the column and direction you’ve chosen travel in the page’s web address, so a sorted view is a link you can bookmark, reload, or send to a teammate. See [Sharing a view with a link](https://codeherder.com/docs/sharing-a-view/) for what else travels with it, and whether **Clear filters** resets your sort.

## Related guides

- [Sharing a view with a link](https://codeherder.com/docs/sharing-a-view/) — everything else that travels in a list page’s web address
- [Finding and tracking your work](https://codeherder.com/docs/tracking-work/) — the Tasks page filter bar, views, and list in full
