# Variables

If you want to save any data, and/or modify it later, you can use **Variables.**

**Variables** are used to store information to be referenced and manipulated. It is helpful to think of variables as containers that hold information.

GMetri experiences fully embrace "variables". Variables allow you to gamify your experiences and orchestrate a variety of interactions. If you want to add interactivity, you would almost always use variables (along with [Rules](/metaverse/build/rules.md)).

{% hint style="info" %}
Using variables is a very powerful tool that can be used to gamify any experience.
{% endhint %}

## Types Of Values in Variables

Variables can store three kinds of values:

* [**Numbers**](/metaverse/build/rules/number-variable-rules.md)&#x20;
* [**String**](/metaverse/build/rules/string-variable-rules.md) (Any character, word, sentence)
* [**Booleans**](/metaverse/build/rules/boolean-variable-rules.md) (TRUE/FALSE).

## Using Variables

{% content-ref url="/pages/qa84JVvb2d84h8GP5DK7" %}
[String Substitution](/metaverse/build/variables/string-substitution.md)
{% endcontent-ref %}

{% content-ref url="/pages/sqNvLjKuyJlIXCoAqwzx" %}
[Capturing User Input](/metaverse/build/variables/capturing-user-input.md)
{% endcontent-ref %}

## Variable Rules

{% content-ref url="/pages/tK6IVaUhCHZGmX5ppdHU" %}
[Number Variable Rules](/metaverse/build/rules/number-variable-rules.md)
{% endcontent-ref %}

{% content-ref url="/pages/CnUAbZhZjQTdpYQ7lMkH" %}
[String Variable Rules](/metaverse/build/rules/string-variable-rules.md)
{% endcontent-ref %}

{% content-ref url="/pages/g4pUiYAKzYJSshw36w8v" %}
[Boolean Variable Rules](/metaverse/build/rules/boolean-variable-rules.md)
{% endcontent-ref %}

## Sources of Variables​

Variables in GMetri come from three different sources:

### **Custom Variables**

These are variables that you add manually to an experience. Go to [Settings > Variables](/metaverse/build/editor/project-settings/variables-in-settings.md), select the type of value you want to store and click "Add Variable". You can then rename the variable from the table below.

Checking the "*Tracking*" option allows you to later check the values stored for that variable, for every user, in Analytics Dashboard

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FAInyzFUqQWOfI2v8LgTn%2Fimage.png?alt=media&#x26;token=e85a0afe-4493-4854-b6e1-fc6d59340bba" alt=""><figcaption><p>Adding Custom Variables</p></figcaption></figure>

### **Global Variables**

Global variables are available for use across all experiences in a workspace. The value of this variable is shared across experiences for any viewer.

Check the following page to learn how to define Global Variables:

{% content-ref url="/pages/4WXjxW1VM8UIm1RM0XE7" %}
[Defining Global Variables](/metaverse/build/portal/global-variables.md)
{% endcontent-ref %}

### **Autogenerated Variables**

These get added automatically. Check the list of autogenerated variables here:

{% content-ref url="/pages/L3MU0pK44lYKrssYhREZ" %}
[Autogenerated Variables](/metaverse/build/variables/autogenerated-variables.md)
{% endcontent-ref %}


---

# 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.gmetri.com/metaverse/build/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.
