# 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="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FIH1UH0EW39pkKeQFQbv5%2Fimage.png?alt=media&#x26;token=02bbe735-ce1c-4b00-9eb2-9a747951a87c" alt=""><figcaption></figcaption></figure>
