> For the complete documentation index, see [llms.txt](https://docs.coupler.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coupler.io/functionality/data-set/data-sorting.md).

# Data sorting

Data sorting allows you to arrange your data in ascending or descending order based on the chosen columns. This would be helpful in finding patterns, trends, or rank values. You can sort strings, numbers, and dates. You can also sort by multiple columns, the first column being the priority sorting criteria.

{% stepper %}
{% step %}
To sort data from your columns, you must click on the sort button:

<div align="left"><figure><img src="/files/eLZZrEfDDQkuyiKhCoOS" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
Click the first dropdown box and select any of the columns you wish to sort

<div align="left"><figure><img src="/files/JZsETWLiCHVH0Fua1Kp6" alt="" width="563"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
Select your desired order (Note: The options change depending on the selected column's data type). For Date, Date time, and Number data types, the options are 1→9 or 9→1. For String, it is A→Z or Z→A

<div align="left"><figure><img src="/files/Fv4I7IbrnkdSaCvXToTq" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
The data will be sorted automatically.
{% endstep %}
{% endstepper %}

Clearing the sort criteria will reset the data back to the original order the data was fetched.

<div align="left"><figure><img src="/files/AL7J73XMvennzgPHyRQQ" alt="" width="375"><figcaption></figcaption></figure></div>

You can also add more sorting criteria based on your preference. However, the priority in sorting depends on which column is at the top. You can move the sorting criteria to change the sorting priority:

<div align="left"><figure><img src="/files/KjvOkIohj4Y5mZUocPkR" alt="" width="375"><figcaption></figcaption></figure></div>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coupler.io/functionality/data-set/data-sorting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
