# Modify Variable Value

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to replace the value stored in an existing variable with the value of another variable. The execution result is stored in the given dynamic variable.

## **Syntax**

&#x20;**Input Value**: `<variable whose value needs to be changed>;<new value>`&#x20;

{% hint style="info" %}
**Note**: The variable name should be within curly braces {}.
{% endhint %}

| Argument                                                            | Description                                                                   |
| ------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| <p>\<variable whose value needs to be changed></p><p>(Required)</p> | Provide the name of the variable whose value you want to modify.              |
| <p>\<new value><br>(Required)</p>                                   | Provide the new value that should replace the existing value of the variable. |

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

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

### **Example: Modifying the Value of an Existing Variable**

In this example, we explain how to update the value of an already created variable during execution.

* **Action**: Modify Variable Value
* **Input Value**: {Username};JohnDoe
  * The first argument (**{Username}**) specifies the name of the existing dynamic variable to update.
  * The second argument (**JhonDoe**) specifies the new value that replace the current value of the variable.
* **Output Value**: {ModifiedStatus}
  * The action status is stored in this **{ModifiedStatus}** dynamic variable with the following possible values:
    * **True**: If the variable value is successfully updated.
    * **False**: If the update fails because the variable does not exist or the input is invalid.

{% hint style="info" %}
**Note**: If the output variable is not defined, the result will be displayed only in the execution logs and not stored in any variable.
{% endhint %}

**Logical Explanation**: The **Modify Variable Value** action takes the value from the **Input Value** column (**{Username};JohnDoe**) and updates the existing dynamic variable {Username} with the new value JohnDoe (Old value is Admin). After the update, the action stores the execution result (True) in the **{ModifiedStatus}** variable.

<figure><img src="/files/9jgMfXbHpTAMclWPraI1" 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/modify-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.
