# 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>`&#x20;

{% hint style="info" %}
**Note:**&#x20;

* 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="/files/gue6SRDlzvKPJDSBGSrZ" 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/generic/variable-operations/get-index-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.
