> 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/web/grid-1/get-total-column-count.md).

# 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

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

<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.
  * 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.
  * 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
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/web/grid-1/get-total-column-count.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.
