# Copy Value

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

## **Syntax**

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

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

| Argument                                   | Description                                                                |
| ------------------------------------------ | -------------------------------------------------------------------------- |
| <p>\<target variable></p><p>(Required)</p> | Provide the name of the variable whose value you want to update.           |
| <p>\<source variable><br>(Required)</p>    | Provide the name of the variable whose value will be copied to the target. |

&#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: Copying the Value from One Variable to Another**

In this example, we explain how to copy the value from an already existing variable into a new variable.

* **Action**: Copy Value
* **Input Value**: {EmpID};{Username}
  * The first argument (**{EmpID}**) specifies the source variable from which the value is taken.
  * The second argument (**{Username}**) specifies the target variable where the value is stored.
* **Output Value**: {Status}
  * The status of the action is saved in the **{Status}** dynamic variable with the following possible values:
    * **True**: If the value is successfully copied.
    * **False**: If the action fails due to an invalid variable name or the source variable not being found.

{% hint style="info" %}
**Note**: If you do not define an output variable, Avo Assure displays the result only in the execution logs and does not store it in any variable.
{% endhint %}

* **Logical Explanation**: The **Copy Value** action takes the value from the **Input Value** column (**{EmpID};{Username}**) and copies the data stored in {EmpID} into {Username}. This is useful when the same data needs to be referenced using a different variable name during execution. After performing the copy operation, the action stores the execution status (True) in the **{Status}** variable.

<figure><img src="/files/Nw43PFBq34XJSRgDNlfM" 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/copy-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.
