# How to create a variable

**URL:** <https://forum.mergado.com/t/how-to-create-a-variable/503>\
**Category:** Variables\
**Created:** [July 8, 2022, 8:24am UTC](https://forum.mergado.com/t/how-to-create-a-variable/503 "2022-07-08T08:24:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![petrmindl](https://forum.mergado.com/user_avatar/forum.mergado.com/petrmindl/32/25_2.png) [@petrmindl](https://forum.mergado.com/u/petrmindl)\
**Post date:** [July 8, 2022, 8:24am UTC](https://forum.mergado.com/t/how-to-create-a-variable/503/1 "2022-07-08T08:24:32Z")

</div>

To create a new variable, go to Variables page and click New variable. Then:

1. Choose an element from which the variable should be created

2. Put a **regular expression** , that represents a way to select a text in a given element

3. In the Test text field, you will see a randomly selected value of the chosen element based on the regular expression that you provided. When you click the two arrows sign, the value will randomly change.

4. Click _ **Test expression** _

5. If you are not happy with the result, you can modify the expression and test again.

6. Once you are happy with the result, just enter a name for the new variable and click _ **Save variable** _.

Creating a new variable example:

 ![image](https://forum.mergado.com/uploads/default/original/1X/03a8c9e9801abc4ca841a268099fe58764fc6f09.png)
