# Variables

Variables allow you to store and manage data within your web application.

You can store values, such as text, numbers, booleans, arrays, or objects, that can be used and manipulated throughout your application. You can use variables to dynamically update content, interact with data from external sources, or control the behavior of your website's elements and components.

{% embed url="<https://www.youtube.com/watch?v=YcTzbIVWU4Q>" %}

In Jet, users can create two types of variables using State Variables:&#x20;

* **Temporary** – for the user session, reset on refresh.
* **Local Storage** – stored in the browser across sessions and pages.

Temporary variables are session-based and are reset when the user refreshes the page, while Local Storage variables are stored in the browser and persist across sessions. Local Storage variables utilize the browser's Storage interface to read and write client-side data.

Builders can use these variables to store local states in their applications, allowing for caching and reusing intermediate states across different APIs and components.

To access the context menu for State Variables, users can find it in the Variables menu, which can be accessed by hovering over the Variables icon on the left-hand side of the App Builder.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FdYlcNRXDJY6FE8qlzKQ7%2Fvar1.jpg?alt=media&#x26;token=f51db6c4-4d9a-4d33-8dfa-6efbb57acaa6" alt=""><figcaption></figcaption></figure>

### **Create a variable**

Depending on how you plan to use your variable, you can choose whether to make your variable **temporary** – only available for the current user session – or **stored** – to be used across browser sessions.

**Scope**

* **Global –** variables that can be accessed from anywhere in your app across pages&#x20;
* **Page** – variables that can be accessed from *only* a specific page
* **Current User** – variables that only a specific user only get access
* **Current Team** – variables that only specific teams only get access

To create new variables, click on plus icon under the scope that you would like to use:

* **Type (text, boolean, date, etc.)**:
  * You can also choose a display format, for example, if you want to display a currency symbol if your variable is for money or if you want to display a percent sign if your variable is a percent.
* **Default value**:  (Optional) set a default value for your variable.
* **Save to local storage / temporary**: `Temporary State Variable, Local Storage State Variable`

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2F7KTw9cPhZiAFum62ombI%2Fimage.png?alt=media&#x26;token=de493e6e-6695-4469-a2b5-692c127bc87f" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FgeFN6NPghxmPBLqlU6YF%2Fimage.png?alt=media&#x26;token=062ef31a-be63-433e-9f23-95372d2c16f8" alt=""><figcaption></figcaption></figure>

### **Set a Variable**

To set up a specific value for a Variable go to Action and choose **Set Variable**

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FO2v7rlh2Rbw6ctMOq3qA%2Fsetup.jpg?alt=media&#x26;token=2f334e2e-43ad-41c0-8dac-c075b00affcd" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FYTdxKCp9fiPCTone4g1Z%2Fimage.png?alt=media&#x26;token=f920cef1-70a3-4f4c-abee-74b28904585d" alt=""><figcaption></figcaption></figure>

###

### **Deleting, editing, or making variables stored/temporary**

If you click on the button with the three dots next to the variable you want to change, a dropdown menu will appear that allows you to delete, edit, or change the variable from temporary to stored and vice versa.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2FRDSJUbDqodky8Ek0yZz5%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202023-03-27%20%D0%B2%2015.21.41.png?alt=media&#x26;token=3ee312da-a377-4951-94f4-7523da677a80" alt=""><figcaption></figcaption></figure>

### **Reference a variable**

You can easily reference a variable by finding or searching for it in the *ƒx formula* menu.

<figure><img src="https://3448227606-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LQ08RFAKZvFADEiXKFy%2Fuploads%2F7UFzh68c84MEGXeW3CVW%2F%D0%A1%D0%BD%D0%B8%D0%BC%D0%BE%D0%BA%20%D1%8D%D0%BA%D1%80%D0%B0%D0%BD%D0%B0%202023-03-27%20%D0%B2%2015.26.04.png?alt=media&#x26;token=981821f7-eed0-492a-93b7-bf4b605862c5" alt=""><figcaption></figcaption></figure>


---

# 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.jetadmin.io/user-guide/variables.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.
