# 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>`&#x20;

<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.
* &#x20;**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: 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.avoautomation.com/avo-assure/actions/grid/sort-table.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.
