# Get Total Column Count

This is a pre-built Action located under the captured grid element. The functionality of this action in Avo Assure is to fetch the total number of columns present in the grid. The result is stored in the given dynamic variable for further use during test execution.

## Syntax                                            &#x20;

**Input Value**: `<header/body>(optional);<left/right>(optional)`&#x20;

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td><p>&#x3C;header/body></p><p>(optional)</p></td><td><p><strong>&#x3C;header/body></strong> (Optional) </p><ul><li><p>Provide the section of the grid from which the column count is taken.</p><ul><li><strong>header</strong>: Counts columns in the grid header (header;left/right).</li><li><strong>body</strong>: Counts columns in the grid body (body;left/right).</li></ul></li></ul></td><td></td></tr><tr><td><p>&#x3C;left/right></p><p>(optional)</p></td><td><p><strong>&#x3C;left/right></strong> (Optional) </p><ul><li><p>Specify whether to count columns in the left fixed or right fixed section of the grid.</p><ul><li><strong>left</strong>: Counts only the columns fixed on the left side.</li><li><strong>right</strong>: Counts only the columns fixed on the right side.</li></ul></li></ul></td><td></td></tr><tr><td>Input - N/A</td><td>If no input is provided, the action counts all visible columns in the grid.</td><td></td></tr></tbody></table>

**Output Value**: `<Dynamic Variable>;<Dynamic Variable>(Optional)`

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>&#x3C;Dynamic Variable><br>(Optional)</td><td>This dynamic variable stores the total column count of grid.</td><td></td></tr><tr><td>&#x3C;Dynamic Variable><br>(Optional)</td><td>This dynamic variable stores the status as <strong>True</strong> or <strong>False</strong>.</td><td></td></tr></tbody></table>

### **Example 1: Retrieving the Total Number of Columns in a Grid**

In this example, we are explaining how to retrieve the total number of columns present in the captured table.

* **Action**: Get Total Column Count
* **Input Value**: N/A
  * This action does not require any input value. It reads the grid and retrieves the total number of columns present in the grid.
* **Output Value**: {Count}
  * The total number of columns available in the grid (5) is stored in the **{Count}** dynamic variable.&#x20;
  * If a second output variable is defined, it stores the action status with the following possible values:
    * **True**: If the total column count is retrieved successfully.
    * **False**: If the total column count is not retrieved successfully.
* **Logical Explanation**: The **Get Total Column Count** action does not require any input value. It reads the captured grid element and calculates the total numbers of columns present in it. The retrieves total column count (5) is stored in the **{Count}** variable.

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

### **Example 2: Retrieving the Total Number of Columns in a Grid using Optional Parameters**

In this example, we are explaining how to retrieve the total number of columns present in the captured table.

* **Action**: Get Total Column Count
* **Input Value**: body;right
  * The first argument (**body**) indicates that the operation should be executed within the grid body.
  * The second argument (**right**) defines the search direction for locating the cell.
* **Output Value**: {Value}
  * The total number of columns available in the grid (5) is stored in the **{Value}** dynamic variable.&#x20;
  * If a second output variable is defined, it stores the action status with the following possible values:
    * **True**: If the total column count is retrieved successfully.
    * **False**: If the total column count is not retrieved successfully.
* **Logical Explanation**: The **Get Total Column Count** action reads the details from the **Input Value** column (**body;right**). It reads the captured grid element and calculates the total numbers of columns present in it. The retrieves total column count (5) is stored in the **{Value}** variable.

<figure><img src="/files/JyJVeLB5ZE77JAEiO3jk" 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/web/grid-1/get-total-column-count.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.
