> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/grid/sort-table.md).

# Sort Table

This is a pre-built action in Avo Assure, available under the **@Grid** element. It allows the user to sort values in a grid, improving data visibility in the table or Grid, and saves the result in a dynamic variable

### Syntax

**Input Value:** `<Column Header>;<Sort Order>`

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>&#x3C;Column Header><br>(Required)</td><td>Column name from the table on which sorting is to be applied. This is case-sensitive.</td><td></td></tr><tr><td>&#x3C;Sort Order><br>(Required)</td><td>Specify the sorting order: ascending or descending</td><td></td></tr></tbody></table>

**Output Value:**

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>&#x3C;Dynamic Variable>(Optional)&#x3C;Dynamic Variable>(Optional)</td><td>This variable holds the results in <strong>True</strong> and <strong>False</strong></td><td></td></tr></tbody></table>

{% hint style="warning" %}
**Note:**

* If we try to apply sort in a column which is not visible on the screen it will fail, and mention Column does not present as error on Avo Assure client.
* If we apply sort on a column which are not sortable it will fail, and mention column is not sortable as error on Avo Assure client.
* Sort Table action is applicable to all grids across all products. Even if the grid has the first row as a filter, it will still work.
  {% endhint %}

**Example:**

**Performs sorting on a specified table column in the defined order**

The **Sort Table** action takes the value from the Input Value column (e.g., **Instrument;ascending**) and sorts the specified column in the given order. The result of the sorting operation is stored in the **{Sort}** variable, while the execution status is stored in the **{Status}** variable, with the following possible values:

* **True** – if the column is sorted successfully.
* **False** – if sorting fails or an error occurs.

<figure><img src="/files/UjtYO3KMzq0wbAJaGEnP" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7s7pFLehucvkdxsZUEP0" alt=""><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.avoautomation.com/avo-assure/actions/grid/sort-table.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
