# State

<figure><img src="/files/HtVyl3WOuvu8RD1Q6lRm" alt=""><figcaption><p>Local State</p></figcaption></figure>

## Creating a Local State Variable

In order to create a **Local State** variable follow the next steps :&#x20;

* Click on the **Add Local State** button
  * Fill the **Field Name** with the name of your variable
  * Choose if your variable should be Persisted or not

    The Application store the value of Persisted variables on the device's storage. If the application is killed and restarted the value is kept.\
    \&#xNAN;*Example : keeping the user preferences of email address remembered or not, to accelerate the sign-in process.*
  * Choose the **Field Type** of your variable\
    \&#xNAN;*Optional : You can select **List** and/or **Nullable** to extends your variable's type.*
  * You can add a **Default Value** to your variable, and can choose between a **Static value** or a **Localized** one

<figure><img src="/files/5UArvpOVXlnKrN04m4P8" alt=""><figcaption><p>Creating a Local State variable</p></figcaption></figure>

## Using a value in your application

In order to use a Local State value in your application follow the next steps :&#x20;

* Select a **Widget**
* In the Properties Section, select the *functions* button
* Select the source to **Local State**
* Click on the now red card **From LocalState** to set the **Local State Variable**
* Click on **Save**

<figure><img src="/files/MaiLd93qdwx7zz31hQEz" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You have set a **Local State Variable** but the preview doesn't change ?

Check the following video to set a **Preview Value**
{% endhint %}

<figure><img src="/files/4hLqnVJcXeJIx0AGia9O" alt=""><figcaption></figcaption></figure>

&#x20;


---

# 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.goril.app/main-pages/state.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.
