# State Variable

Any View can contain as many state variables as required, and its value can be set up as a constant or bound dynamically. State variables are not accessible between other Views; this means that every View can contain the same-named variables serving a different purpose.

<div align="left"><img src="/files/0RUVGwXUJfxDCtT0p2Vk" alt="Different State variables"></div>

Each of the variables has a unique ID, value, and type. Selecting the desired variable allows one to set up attributes in the Inspector panel. There is also an option to delete the current variable.

{% tabs %}
{% tab title="Inspector Option" %}
![](/files/DmOGlA7qh28RPaZJFnPf)
{% endtab %}

{% tab title="Variable ID" %}
![](/files/r26x1SxZcygDce3ehryc)
{% endtab %}

{% tab title="Options Settings" %}
![](/files/T98720p1ZVIzStyCv8GJ)
{% endtab %}

{% tab title="Delete Variable" %}
![](/files/WI4GMQHAaC8uuJoDV1XM)
{% endtab %}
{% endtabs %}

Value types of state variables are dependent on their usage. The most common String value is set up as a default, but options for Number, Boolean, Password, Map, and Array are also set up. Value-type can be changed by clicking on the proper icon.

{% tabs %}
{% tab title="String" %}
![](/files/3IUnunRKWdt2PD9njQNA)

*`ƒx: "Hello World"`*

![](/files/ZIFBouz2ZB5R9SgeKysT)
{% endtab %}

{% tab title="Number" %}
![](/files/AWSPUVDe4HOcBa4qazOt)

*`ƒx: 123`*

![](/files/tHMtRDnW5Seia9YE6TDJ)
{% endtab %}

{% tab title="Boolean" %}
![](/files/L3oWuJsJQ8wVsWKxTmxo)

*`ƒx: true`*

![](/files/cOFNKC7Wx92cP1Ap6Su0)
{% endtab %}

{% tab title="Password" %}
![](/files/XCKnIunCcTQEbnxvq8AH)

*ƒx: `"TopSecret123"`*

![](/files/SpQRYjh3siNvSjtldlQx)
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Adding Map Items" %}
![](/files/aqlqshF4d0PLNqegG5Tu)

*ƒx: {first: "value1", second: "value2"}*

![](/files/EnHzCIW6OfH77CT33FAH)
{% endtab %}

{% tab title="Editing Items Values" %}
![](/files/ZBVEJckKcYkNIHE3zv50)
{% endtab %}

{% tab title="Deleting Map Items" %}
![](/files/m620GCIKM9RSj0KOJU01)
{% endtab %}

{% tab title="Define Items Valuetypes" %}
![](/files/35sJAaIBc3wFlL4V44KH)
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Adding Array Items" %}
![](/files/izXO1f3z5eMTl6RZzeNM)

*ƒx: \["value1", "value2"]*

![](/files/bLKF1AkyFriBKtAmpON8)
{% endtab %}

{% tab title="Editing Items Values" %}
![](/files/7PTimbLjHmCf5Ux3bCC5)
{% endtab %}

{% tab title="Deleting Array Items" %}
![](/files/2uhQF3ObuCCjhpdkfWZb)
{% endtab %}

{% tab title="Define Items Valuetype" %}
![](/files/bvbtkZ0wIBnr5Ui3QUgA)
{% endtab %}
{% endtabs %}

All existing state variables and their values are visible in Data explorer. Any changes in names or values are immediately reflected.

{% tabs %}
{% tab title="String State Variable" %}
![](/files/yMSHdeht137moMPmpiVI)
{% endtab %}

{% tab title="Data Explorer State Variable" %}
![](/files/8jsDq0KzUzGtUnRpcXi8)
{% endtab %}
{% endtabs %}

Referencing variable values have to always correspond with Data explorer annotations.

```
variable1.value
```

Even updating a state of the variable by calling the proper function has to hold the correct syntax.

{% tabs %}
{% tab title="Updating State by Event" %}
![](/files/lRt8PPDed04v9gFls4lA)
{% endtab %}

{% tab title="Update State Configuration" %}
![](/files/cc0WKrRlVahqCw2nSTRa)
{% endtab %}
{% endtabs %}

State variables can refer to each other.

{% tabs %}
{% tab title="Referencing To Logged User" %}
![](/files/RqOCF0tzuGTnmDIZKs7y)
{% endtab %}

{% tab title="Associating Variable To Component" %}
![](/files/8o4ajRDalGlxyOGsCGyl)
{% endtab %}

{% tab title="Output" %}
![](/files/QaZBw0VMBz98GAEIEqhV)
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.adapptio.com/getting-started/editor/outline-panel/data-variables/state-variable.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
