> For the complete documentation index, see [llms.txt](https://docs.work-relay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.work-relay.com/forms/form-building/variables.md).

# Variables

You can create variables within a form and with the help of functions feature set up complex calculations, conditions, conditional styling and etc.

Below is example of setting up variable and using it for conditional hiding a section.

{% hint style="info" %}
Form in the example below is tied up to Account object.
{% endhint %}

Open "Tools" menu on the form header and select "Variables" option (2):

![](/files/7f39685ac870345c182fc9af07190b3bb8192437)

On "Variables" popup (3) click "Add variable" button (4):

![](/files/8b088b278e34f60783d87ba1228eb3d7d3f95972)

Provide variable name (5) and click edit icon (6) to open merge field builder (7):

![](/files/676f66c8e241ebcd1ae8a9c5f1ce8bf7d67de4a8)

Select context object (8) and object field (9). Using merge field (10) and functions (11) build and expression and click "Save" button (12):

{% hint style="info" %}
For more information about working with context objects please refer following documentation chapter: [Context objects](/forms/form-building/context-objects.md)
{% endhint %}

![](/files/394ed34baaa4f5dc43f380c5cb61493e9c7fa278)

{% hint style="info" %}
To use the functions or calculations inside of variable you have to build a formula like: `FORMULA[SQRT(4) + (2*3)]`
{% endhint %}

![](/files/e146ddb05d4d5abb5d2e66b331f665d2d45bcef5)

{% hint style="info" %}
Above expression first casts number typed value to text and then checks if final string ends with "9". It will return "TRUE" if string does end with "9" and false if it doesn't.
{% endhint %}

Save "Variables" (13) and save the form (14).

![](/files/3cf037280f894411079adc4b1d3302005cc1a893)

Click on section title and create new conditional style using variable:

![](/files/8e7ff7efde927ebed69befe5143eeae9eff297f7)

{% hint style="info" %}
Above conditional style will hide section if "Account Number" value ends with symbol other than "9" and will show it for cases when it ends with "9".
{% endhint %}
