# Get Total Row Count

This is a pre-built Action located under the **@Excel Element**. The functionality of this Action in Avo Assure is to fetch the total number of rows present in the Excel file. The result of this operation is stored in a dynamic variable for further use during test execution.

{% hint style="info" %}
**Note**: While retrieving the total row count of the specified Excel sheet, Avo Assure considers the header as the first row.
{% endhint %}

## Syntax                    &#x20;

**Input Value**: `<column number(optional)>`&#x20;

| Argument                              | Description                                                                                                                                                                                                                                                                      |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<column number><br>(Optional)</p> | <p>Provide the column number based on the requirement.</p><ul><li>When you do not provide a column number, the action counts all rows in the Excel sheet. </li><li>When you provide a column number, the action counts only the rows that contain data in that column.</li></ul> |

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

| Argument                                  | Description                                                                |
| ----------------------------------------- | -------------------------------------------------------------------------- |
| <p>\<Dynamic Variable><br>(Required)</p>  | This dynamic variable stores the total numbers of rows of the Excel sheet. |
| <p>\<Dynamic Variable> <br>(Optional)</p> | This dynamic variable stores the status as **True** or **False.**          |

### Example 1: Retrieving Total Row Count without Specifying a Column

In this example, we explain how to retrieve the total number of rows from an Excel sheet when no specific column number is provided.

* **Action**: Get Total Row Count
* **Input Value**: N/A
  * This action does not require any input value. It automatically counts all the rows present in the active Excel sheet configured earlier through the **Set Path for File** action.
* **Output Value**: {Row Count}
  * The total number of rows containing data (e.g., 9) is stored in the **{Row Count}** dynamic variable.
  * If a second output variable is provided, the action returns the status as True/False:
    * **True**: If the total row count is retrieved successfully.
    * **False**: If the total row count is not retrieved successfully.
* **Logical Explanation**: The **Get Total Row Count** action retrieves the total number of rows available in the Excel sheet. When no column number is specified, Avo Assure counts all rows that contain data in any cell. The retrieved row count is stored in the **{Row Count}** variable (e.g., 9).

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

### Example 2: Retrieving Total Row Count Based on Column Number

In this example, we explain how to retrieve the total number of rows from an Excel sheet based on a specified column number.

* **Action**: Get Total Row Count
* **Input Value**: 2
  * The column number, **2**, specifies that the row count should consider only those rows where column 2 contains data in the Excel sheet configured earlier through the **Set Path for File** action.
  * This allows Avo Assure to count rows selectively based on data availability in a specific column.
* **Output Value**: {Row Count}
  * The total number row containing data (e.g., 11) is stored in the **{Row Count}** dynamic variable.
  * If a second output variable is provided, the action returns the status as True/False:
    * **True**: If the total row count is retrieved successfully.
    * **False**: If the total row count is not retrieved successfully.
* **Logical Explanation**: The **Get Total Row Count** action takes the value from the **Input Value** column **2** and retrieves the total number of rows containing data in 2nd column of the Excel sheet. The resulting row count is stored in the **{Row Count}** variable (e.g., 11).

<figure><img src="/files/XJfjVBdxXN1P2yftK3wV" 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/excel/get-total-row-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.
