# Display Variable Value

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to display the value stored in a variable during execution or debugging. The execution result is stored in the given dynamic variable

## **Syntax**

&#x20;**Input Value**: `<variable>`

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

* The variable name should be enclosed within curly braces {}.
* A display variable popup displays the variable name and its value.
* The input variable must already exist. When the user provides a non-existing variable, the **Avo Assure-Display Variable** displays null as the variable value.
* By default, the **Avo Assure-Display Variable** dialog box remains visible for 3 seconds. You can increase or decrease this duration in the config.json file under the **displayVariableTimeOut** tag.
* The action supports both static and dynamic variables.
* You can also provide an index to a display variable by using another dynamic variable. The index starts from 0. For example:
  * **1-dimensional array**: {variable\[index value]}
  * **2-dimensional array**: {variable\[index value],\[index value]}&#x20;
    {% endhint %}

| Argument                            | Description                                                       |
| ----------------------------------- | ----------------------------------------------------------------- |
| <p>\<variable></p><p>(Required)</p> | Provide the name of the variable whose value you want to display. |

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

| Argument                                                    | Description                                                       |
| ----------------------------------------------------------- | ----------------------------------------------------------------- |
| \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional) | Both dynamic variables store the status as **True** or **False**. |

### **Example 1: Displaying the Value of a Stored Variable**

In this example, we explain how to display the current value of an existing variable during test execution.

* **Action**: Display Variable Value
* **Input Value**: {EmpID}
  * The argument (**{EmpID}**) specifies the variable whose stored value needs to be displayed at runtime.
* **Output Value**: {Status} (Optional)
  * If an output variable is provided, then action returns the execution status as **True** or **False**:
    * **True**: If the variable value is displayed successfully.
    * **False**: If the action fails due to an invalid variable name or missing value.
* **Logical Explanation**: The **Display Variable Value** action retrieves the value stored in the variable provided in the **Input Value** column (**{EmpID}**) and shows it in the **Avo Assure – Display Variable** dialog box during execution or debugging. As shown in the screenshot, the value (331399) assigned to **{EmpID}** is displayed to help users verify or troubleshoot the stored data.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2F5HufIkZ5tDn2TpcoGLiq%2Fimage.png?alt=media&#x26;token=7d64a05d-6d68-4cab-9b36-b99627935006" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2F1uKYsIvBiKBe3UPKWyoA%2Fimage.png?alt=media&#x26;token=c5d14a00-e2c5-4cf0-8b70-dc6fe03e0dea" alt="" width="375"><figcaption></figcaption></figure>

### Example 2: **Displaying a String Value from an Array Using Index**

In this example, we explain how to fetch and display a specific element from an array-type dynamic variable.

* **Action**: Display Variable Value
* **Input Value**: {Values\[1]}
  * The argument (**{Values\[1]}**) specifies that the action should retrieve the value stored at index 1 of the dynamic array variable **{Values}**.
* **Output Value**: {DisplayedValue} (Optional)
  * If an output variable is provided, then action stores the execution status with the following possible values:
    * **True**: If the value is retrieved successfully.
    * **False**: If the array does not exist or the index is invalid.
* **Using Array Index**:
  * When the action displays the array, you access its values using index value as shown below.
    * **{Values\[0]}** → stores **12**
    * **{Values\[1]}** → stores **34**
    * **{Values\[2]}** → stores **23**
    * **{Values\[3]}** → stores **45**
* **Logical Explanation**: The **Display Variable Value** action displays the 1<sup>st</sup> index value by using the (**{Values\[1]}**) variable as input and displays the indexing value 34 in the **Avo Assure - Display Variable** dialog box.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2F3iMHap9rPgZl8WkQfDre%2Fimage.png?alt=media&#x26;token=f4d377ea-0a7b-427b-82a4-c84a401bc47f" alt=""><figcaption></figcaption></figure>
