> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/generic/variable-operations/create-constant-variable.md).

# Create Constant Variable

This is a pre-built Action located under the **@Generic Element**. The functionality of this Action in Avo Assure is to create a constant variable, assign the value provided in the input value column, and use it when a fixed value must remain unchanged throughout the test execution. The execution result is stored in the given dynamic variable.

## **Syntax**

**Input Value**: `<Constant Variable>;<Value>`

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

* Variable name should be enclosed between underscores. For example: \_var\_.
* A constant variable in Avo Assure stays the same throughout the execution at the Project Level.
* If the test step tries to modify the value of a constant variable, then the test step will fail.
* If the constant variable is not already created but is used in the **Output Value** field, Avo Assure creates the constant variable with the name given by the user and stores the test step result in it.
  {% endhint %}

| Argument                                     | Description                                                                                                                                                                                         |
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<Constant Variable></p><p>(Required)</p> | Provide the name of the constant variable you want to create.                                                                                                                                       |
| <p>\<Value><br>(Required)</p>                | <p>Provide the value you want to store in the constant variable.<br>Supported variables are:</p><ul><li>Number</li><li>String</li><li>Alphanumeric</li><li>Special Characters</li><li>URL</li></ul> |

**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: Creating a Constant Variable with a Fixed Value

In this example, we explain how to create a constant variable that remains unchanged during the entire test execution.

* **Action**: Create Constant Variable
* **Input Value**: \_AppURL\_;<https://avotestlab.avoassure.ai>
  * The first argument (**\_AppURL\_**) specifies the name of the constant variable.
  * The second argument (**<https://avotestlab.avoassure.ai>**) specifies the value of the constant variable.
* **Output Value**: {Status}
  * The execution status of the action is stored in this **{Status}** dynamic variable with the following possible values:
    * **True**: If the constant variable is created and assigned successfully.
    * **False**: If the variable creation fails due to invalid input or format.

{% 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 **Create Constant Variable** action fetches the value from the **Input Value** column (**\_AppURL\_;<https://avotestlab.avoassure.ai>**). It creates a constant variable named (\_AppURL\_) and assigns the value (<https://avotestlab.avoassure.ai>) to it. The execution result is stored as (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%2FtJbQy9LFK3HSfntxtmkn%2Fimage.png?alt=media&amp;token=c560ba2d-dcef-4c84-a48b-c6ccc46c2d89" alt=""><figcaption></figcaption></figure>

#### **Knowledge Bites:**

Here are some examples of different variable scenarios:

<table><thead><tr><th>Variable</th><th width="279">Input Value</th><th width="272">Result</th></tr></thead><tbody><tr><td>Text Variable</td><td>_Username_;Admin</td><td>True</td></tr><tr><td>Numeric Variable</td><td>_OTP_;35629</td><td>True</td></tr><tr><td>Alphanumeric Variable</td><td>_EmpID_;OJ1002</td><td>True</td></tr><tr><td>Wrong Input Variable</td><td>__Password__;Admin@12</td><td>False</td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avoautomation.com/avo-assure/actions/generic/variable-operations/create-constant-variable.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
