Skip to content

Sorting records: order the server applies, level by level

Multi-level sorts applied by the server as SQL and saved per view: why selects sort in choice order, which field types sort, and where empty cells go.

Updated November 2026

A sort is part of the view. Set "Deliver by, earliest first" on a view and it's set for everyone who opens that view. The server applies it as a SQL ORDER BY, which is why sorting a 100,000-record table takes no heavy work from your browser.

The Sort panel over the Orders grid: sort by Deliver by, then by Total, each with its direction toggle.

Set one

  1. Open Sort in the view bar.
  2. Pick a field. The direction button beside it toggles between ascending and descending, and it's labeled in the field's own terms: A→Z on text, 1→9 on numbers and dates, No→Yes on a checkbox, and First→Last on a select, which sorts in choice order, not alphabetically. Hover the button for the long version ("Earliest first" or "Checked first").
  3. Add sort adds another level. The panel reads the way the levels work, sort by the first and then by the next. Ties in level one are broken by level two, and so on.

You can also start from the grid. A field's header menu (the chevron beside its name) offers Sort A→Z and Sort Z→A, again in the field's own terms (it's Sort 1→9 on a number). Picking one sorts the view by that field alone and replaces whatever sort the view had. The Sort panel then shows it like any other sort.

With no sort at all, the panel tells you what you get, which is records in their natural order. That's the order they were created in, and it's also the stable order paging relies on.

How selects sort

Sorting by a select field orders records by the field's choice order, not alphabetically. New → Preparing → Out for delivery → Delivered → Cancelled is a pipeline, and A→Z would turn it into Cancelled, Delivered, New…, which means nothing. You set the order once, in the field, and the sort uses it. To change the sort, reorder the choices.

A few more rules about where values go:

  • Empty cells sort last when ascending and first when descending, so reversing a sort reverses everything, empty cells included.
  • Ascending on a checkbox puts unchecked before checked.
  • Text sorts the way a person alphabetizes it. Capitals don't come first (Sweet and Sneezy sorts before Sweet Dream Schemes, not after every capital letter in the field), and an accented letter sorts with its plain one: Émile goes next to Emile, not somewhere past Z. This is ICU's language-neutral ordering, which we chose so that a database holding Arabic and English side by side isn't sorted by English's rules.
  • Numbers inside text sort as numbers. Room 2 comes before Room 10, and codes typed into a text field (1020, 1030, 10000, 10100) keep their numeric order instead of being sorted digit by digit. Digits written in Arabic script (٢, ١٠) count too.

Which field types sort

Everything sorts except attachments and buttons. That covers single line text, long text, email, phone, URL, member, number, currency, percent, rating, duration, date, checkbox and single select, plus formula fields, which sort as whatever they produce.

A field that can hold several values sorts by the first one in the cell. A multi select sorts by its first choice, in the choice order. A member list sorts by its first person, and a linked record field by the name of its first linked record. A rollup sorts by its value (as in "Guests, most nights first"), and a count reads 0 for a record that links nothing. A lookup sorts by its first value when the lookup shows plain values (text, a number, a date, a checkbox).

Where the sort shows up

A view's sort shows up in every layout but one. The grid orders its records by it, the gallery's cards follow it, and on the board every column orders its cards by it. The calendar is the exception. It is always in date order, so it has no Sort button at all.

On a grouped grid, Sort holds two orders. Groups, on top, arranges the groups themselves. Records in each group, below it, is the same builder described here, applied inside every group. That lets the statuses be ordered by how many orders each holds while the orders inside each status are ordered by total.

Over the API, the same sorts are the sort= parameter, as in sort=fld_abc:desc,fld_def:asc, with the same fields and the same rules. See /docs/api.

The questions people ask

Does sorting rearrange the stored table? No. A sort only changes how one view shows the records. The table's own order stays what it was, which is creation order, and every other view keeps its own sort. Remove the sort and you'll see that nothing has moved.

Can I drag records into a custom order? Not today. Order in Tabla always comes from a sort or from creation order. When you need an order you set by hand, put it in the data. A number field (1, 2, 3…) that you sort by gives you an order you can also edit, filter on and read over the API.

Why did my sorted view shuffle when someone edited a record? Because the sort is live. Change a record's Deliver by and the record moves to where that date now belongs, for everyone with that view open, with no reload. A record someone creates shows up in its sorted place the same way, not at the bottom.

The one record that doesn't move is the one you are editing. It stays where it is while you work, so a value you're halfway through typing never moves out from under you. It takes its new place the next time the view loads.

How do I tell which field a view is sorted by? Its header has a small arrow in your database's color, pointing down for descending and up for ascending, with a number beside it when more than one field is sorted. The arrow is the only sort mark. The sorted field's records get no tint, because a wash on a record already means a color rule matched.

About Tabla

Tabla is a no-code database with Postgres underneath. Every feature is on every plan, you get a million records per database, and you can export your whole database in one file any day.

More guides