# 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:

* **Ture** – if the column is sorted successfully.
* &#x20;**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&#x26;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&#x26;token=7d00cb31-06af-4f73-933e-13dc46b9361a" alt=""><figcaption></figcaption></figure>
