# How to sort records?

Sorting in the records table sets row order by one or more fields. Rules can be saved in a **Saved view** with filters and columns.

## When you need this

- You need records ordered by date, name, or number.
- You want newest or oldest rows on top.
- You need multi-field sort for analysis.

## Key terms

- **Sort** — toolbar button on the records table.
- **Add sort rule** — new rule: field + **Ascending** or **Descending**.
- **Group field is sorted first** — when row grouping is enabled.
- Column menu — **Sort ascending** / **Sort descending** (quick single-column sort).
- **Sort** can be included in **Save view**.

## Before you start

- [x] Records table is open.
- [x] The field has **Column sorting** enabled in the editor (default for most types).

## Step-by-step

1. Open the table in **Custom Data**.
2. Click **Sort** in the toolbar.
3. Click **Add sort rule**:
   - **Select field**.
   - Choose **Ascending** or **Descending**.
4. Add a second rule for compound order (e.g. category then date).
5. Click **Apply** — rows reorder.
6. Alternative: open **Column menu** (column header) → **Sort ascending** or **Sort descending**.
7. To persist order — **Save view** with **Sort** enabled.

### Large tables: safe order

If the table has a very large number of records, the chosen sort may not apply instantly. In that case:

- a **banner** appears above the table explaining which sort you chose and which sort is actually applied;
- records are shown in a **safe order** — the table stays available;
- an administrator can **check whether sorting can be sped up**.

Learn more: [How to speed up sorting on a large table](/en/customdata/how-to/prepare-sort-index-for-large-table.md) · [How large tables work](/en/customdata/explanation/how-large-custom-data-tables-work.md)

## What happens next

Rows display in the chosen order. Pagination and filters apply on top of sort.

## How to verify

- First and last rows match the field and direction.
- After saving a view, order restores when you reopen it.

## Other options

- **Pin** columns — separate from row order; pin left/right.
- **Group** — different axis; **Sort** works inside groups when grouping is available.

## Related guides

- [Filter records](/en/customdata/how-to/filter-records.md)
- [Use saved views](/en/customdata/how-to/use-saved-views.md)
- [View table records](/en/customdata/how-to/view-model-records.md)
- [Speed up sorting on a large table](/en/customdata/how-to/prepare-sort-index-for-large-table.md)
- [How large tables work](/en/customdata/explanation/how-large-custom-data-tables-work.md)
