> For the complete documentation index, see [llms.txt](https://docs.ninox.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ninox.com/user-hub/common-tasks/work-with-data/sort-and-group-records-in-a-table.md).

# Sort and group records in a table

Arrange and organize visible records in a table view.

Sort records to bring values into a useful order. Group records with the same field value together. Use both features to scan related records, compare categories, and find information faster.

### Sort records

{% stepper %}
{% step %}

#### Open sorting

Open the table view you want to organize.

Click **Sort** in the table toolbar.

<figure><img src="https://2148310202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBmcFtwhLmWInCVTaddAT%2Fuploads%2Fq8w2yOeADhEJo2S6DQbn%2Ftable%20view_sort_editor_en.png?alt=media&amp;token=d3f7de58-9cbd-463b-bce6-19b167ad5f34" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Choose a field and direction

Select the field to sort by.

Click <i class="fa-arrow-up">:arrow-up:</i> **Ascending** or <i class="fa-arrow-down">:arrow-down:</i> **Descending**.
{% endstep %}
{% endstepper %}

The toolbar shows the name of the field used for sorting. The selected sort field's column header shows <i class="fa-arrow-up">:arrow-up:</i> or <i class="fa-arrow-down">:arrow-down:</i>. Click that column header to change its sort direction.

**Color** fields sort alphabetically by color name. For example, `blue` sorts before `red` in ascending order. **Icon** fields use the same alphabetical ordering by icon name.

### Group records

{% stepper %}
{% step %}

#### Open grouping

Open the table view you want to organize.

Click **Group** in the table toolbar.

<figure><img src="https://2148310202-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBmcFtwhLmWInCVTaddAT%2Fuploads%2FDV7YQCmb4W3xFFEN2ddq%2Ftable%20view_group_editor_en.png?alt=media&amp;token=8d141b74-bac9-4866-84ba-906ff3c5b5c4" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Choose a field and direction

Select the field that defines each group.

Ninox groups visible records by that field. You can group by a field even when its column is hidden.

Click <i class="fa-arrow-up">:arrow-up:</i> **Ascending** or <i class="fa-arrow-down">:arrow-down:</i> **Descending** to set the group order.

The toolbar shows the name of the field used for grouping.
{% endstep %}

{% step %}

#### Clear grouping

Click **Clear grouping** to remove grouping.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
For **Rich text** fields, records group together only when content and formatting are identical.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ninox.com/user-hub/common-tasks/work-with-data/sort-and-group-records-in-a-table.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
