# Get Value by Index

This is a pre-built Action located under the captured dropdown elemen&#x74;**.** The functionality of this action in Avo Assure is to fetch the value from a dropdown based on the index number specified in the Input Value. The result is stored in the given dynamic variable for further use during test execution.

## **Syntax**

**Input Value**: `<Index>`

| Argument                         | Description                                                                      |
| -------------------------------- | -------------------------------------------------------------------------------- |
| <p>\<Index></p><p>(Required)</p> | Provide the numerical index of the value you want to retrieve from the dropdown. |

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

* Only numerical values are allowed in input.
* In the above syntax, the Index always starts from 0
  {% endhint %}

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

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

### **Example: Retrieving a Value from a Dropdown Using an Index Position**

In this example, we explain how to fetch a specific value from a dropdown using its index.

* **Action**: Get Value by Index
* **Input Value**: 4
  * The argument (**4**) specifies the index position from which the value should be retrieved.
* **Output Value:** {Value}
  * The retrieved dropdown item is (e.g., Last 3 Month) 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 value is retrieved successfully.
    * **False**: If the value is not retrieved successfully.
* **Logical Explanation:** The **Get Value by Index** action takes the value from the **Input Value** column (**4**) and retrieves the item located at index position 4 in the dropdown. The fetched value is (e.g., Last 3 month) stored in the **{Value}** variable.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FWRhfMS0WVrhMqCwnLDT1%2Fimage.png?alt=media&#x26;token=a9daf6c1-86f3-44bf-8c53-0562d29418f0" alt=""><figcaption></figcaption></figure>
