> 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="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FdH3yZtWEl83AiUO9KobR%2Fimage.png?alt=media&amp;token=6eb53d66-defb-4444-a228-40dbdd244931" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FGmHtwo2s0Qtei9m9m0gH%2FSort%20Table1.png?alt=media&amp;token=7d00cb31-06af-4f73-933e-13dc46b9361a" 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 by asking a question.

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

```
GET https://docs.avoautomation.com/avo-assure/actions/grid/sort-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.
