> 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/preview-data/data-sorting.md).

# Data sorting

Sort data in your Coupler.io Data Set by one or more columns in ascending or descending order before exporting to your destination.

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="https://2487187314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCgnmco7kCnvytNIN8YdT%2Fuploads%2F7ndruEPhFtDIv94POEv7%2Fimage.png?alt=media&amp;token=5d341829-9db9-4684-93ac-e24c1d98577d" 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="https://2487187314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCgnmco7kCnvytNIN8YdT%2Fuploads%2FNEAkZxhvG1xkEJnHyUcS%2Fimage.png?alt=media&amp;token=ce78da80-86e9-442f-93a3-9184c865aceb" 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="https://2487187314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCgnmco7kCnvytNIN8YdT%2Fuploads%2FTrSHQeSPsCwNXcKRT2f5%2Fimage.png?alt=media&amp;token=84cd9067-047f-47d5-acc5-4a58c4505379" 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="https://2487187314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCgnmco7kCnvytNIN8YdT%2Fuploads%2FxPjD2Vk56MdPqSDDpZ3F%2Fimage.png?alt=media&amp;token=466ea709-9f1c-4232-95b5-f249fbf5c899" 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="https://2487187314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCgnmco7kCnvytNIN8YdT%2Fuploads%2FZPoHT3FSR6UceIWppLHC%2Fimage.png?alt=media&amp;token=29dd4af0-313f-4fe7-8262-0b1b20485a2e" 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 by asking a question.

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

```
GET https://docs.coupler.io/functionality/preview-data/data-sorting.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.
