# 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="/files/fuhZbTJZRn86Yv7pjPFi" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/eEVDlo3yCIusMA3ip1Rh" 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="/files/TvVZVg07XSTETJe07qPn" 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/display-variable-value.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.
