> For the complete documentation index, see [llms.txt](https://docs.adapptio.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adapptio.com/working-with-adapptio/how-to/data-and-dynamic-values/custom-variable.md).

# Custom Variable

### The Goal

Add and set up *Custom Variable* and check its setting in the *Data Explorer*.

![Custom Variable](/files/uhZBuwhXhoip8lGZOeP4)

### The Description

The *State Variable* is part of a current *View* where its setting is immediately reflected in the *Data Explorer* and its plays important role in storing temporary data within a current *View*.

{% hint style="info" %}
Keep in mind that *State Variables* are not addressable between another *Views*.
{% endhint %}

### The Knowledge You Will Get

1. *Addressing* and *Editing* of a *State Variable*.

### The Project Structure

{% tabs %}
{% tab title="View\[MainView]" %}

* [ ] State Variable\[`myVariable`]
  {% endtab %}
  {% endtabs %}

### 1. Create a State Variable

1. Clicking on the *Add Datasource icon* select **Add State Variable**.
2. Name its *ID* -> `myVariable` and switch its *Type* to *Number*; *Initial Value* -> `6`

{% hint style="info" %}
You can watch the `myVariable` *attributes* and *functions* in the *tab* from this moment.
{% endhint %}

{% tabs %}
{% tab title="Outline\[myVariable]" %}
![](/files/lrB9lCYn478nAyMyCLdT)
{% endtab %}

{% tab title="Data Explorer\[myVariable]" %}
![](/files/bqK6JnqVNtBxKYk7NuTT)
{% endtab %}
{% endtabs %}

### 2. Associating `myVariable` Value

1. Consider that we are not going to play with *Layout*; simply place in the *Canvas work field* a new **Text** component and set up its *Value* as follows:
2. *Value* -> `myVariable.value`

{% hint style="info" %}
The Current Value of the myVariable can be dynamically mapped by a (ƒx) *function*.
{% endhint %}

{% tabs %}
{% tab title="Canvas\[MainView]" %}
![](/files/ZdhFtE3pj9MOHR0NtyRU)
{% endtab %}

{% tab title="text1\[Value fx]" %}
![](/files/hAWyM1psMPb6e5BTzCKE)
{% endtab %}
{% endtabs %}

### The Conclusion

Using the *State Variable* can be effectively used in many cases. Try to change *State Variable Types* to *Array* or *Map*, and define their *Values* as a constant or function.

{% hint style="info" %}
Follow up on our *Custom Variable* tutorial <https://youtu.be/ul_NTuZODWc>
{% endhint %}
