> 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/generic/variable-operations/get-index-count.md).

# Get index count

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to retrieve the total number of items (index count) present in a list within the AUT. The execution result is stored in the dynamic variable.

## **Syntax**

**Input Value**: `<variable containing list value>`

{% hint style="info" %}
**Note:**

* The variable name should be enclosed within curly braces.
* To display the variable:
  * For a 1-dimensional array, the index starts from 0, and the array count will start from the 0th index. For example, if the count is 7, it will fetch a value of 6.
  * For Desktop AppType, the index starts from 1, and the array count will start from the 1st index.
    {% endhint %}

| Argument                                               | Description                                                 |
| ------------------------------------------------------ | ----------------------------------------------------------- |
| <p>\<variable containing list value><br>(Required)</p> | Provide a list which total number of items will be counted. |

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

| Argument                                    | Description                                                           |
| ------------------------------------------- | --------------------------------------------------------------------- |
| <p>\<Dynamic Variable><br>(Required)</p>    | This dynamic variable stores the number of items present in the list. |
| <p>\<Dynamic Variable></p><p>(Optional)</p> | This dynamic variable stores the status as **True** or **False**.     |

### **Example:** Retrieving the Total Number of Items in a List

In this example, we explain how to retrieve the total number of items present in a list.

* **Action**: Get Index Count

{% hint style="info" %}
**Note**: Before you use the **Get Index Count** action, make sure a previous step **Get All Values from List** action retrieves the list items and stores them in a dynamic variable. For example: {Values}.
{% endhint %}

* **Input Value:** {Values}
  * The argument (**{Values}**) specifies the dynamic variable that contains the list whose total number of items needs to be calculated.
  * The stores array list in this **{Values}** variable is: \['HTML, 'Python', 'Java']
* **Output Value:** {Count}
  * The fetched number of items (3) present in the list is stored in this **{Count}** dynamic variable.
  * If a second output variable is provided, then action returns the status as **True** or **False**:
    * **True**: if the index count is retrieved successfully.
    * **False**: if the action fails due to an invalid or empty list.
* **Logical Explanation**: The **Get Index Count** action takes the list variable provided in the **Input Value** column (**{Values}**) and calculates how many items exist in that list. It stores the total number of items (3) in the **{Count}** variable.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FRSuhq6R0Aoj70ZHqDrbE%2Fimage.png?alt=media&amp;token=b7713eba-150d-4b12-a8fd-83679fdd1a12" 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/variable-operations/get-index-count.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
