# Add Variable

### Introduction

The Add Variable button can be clicked to add new variables to a selected screen, component, or behavior. Variables added to screens and components are referred to as *custom variables.* Custom variables differ from variables which come from standard elements in the following ways:

* Custom variables are defined at the screen or component level and cannot be added to standard elements
* Custom variables can be renamed
* Custom variables can be deleted
* Custom variables do not have automatic built-in functionality, although they can be used in [Variable References](/gum/gum-tool/gum-elements/general-properties/variable-references.md)

### Adding Variables

To add a variable, select a screen or component and click the Add Variables button.

<figure><img src="/files/QVH9SJZI5x5pHcmW9wNQ" alt=""><figcaption><p>Add Variable button in the Variables tab</p></figcaption></figure>

Select the variable type and enter the variable's name in the popup window.

<figure><img src="/files/rJvn8n9m4ZdxzVUKpTZ2" alt=""><figcaption><p>Add Variable popup window</p></figcaption></figure>

Newly added variables appear in the Variables tab.

<figure><img src="/files/5iO71TMNMK5O8WwIGd5J" alt=""><figcaption><p>New variable in the Variables tab</p></figcaption></figure>

Custom variables can be edited just like any other variable but they do not have any built-in behavior such as modifying the appearance of objects in the Editor tab.

### Removing Custom Variables

Custom variables can be removed by right-clicking on the variable and selecting the Delete Variable item.

<figure><img src="/files/AOKXAKZgIEZc1owBZLBy" alt=""><figcaption><p>Delete Variable right-click item</p></figcaption></figure>

### Editing Variables

Existing custom variables can be edited by right-clicking on the variable and selecting the Edit Variable item.

<figure><img src="/files/AOKXAKZgIEZc1owBZLBy" alt=""><figcaption><p>Edit Variable right-click item</p></figcaption></figure>

Custom variable names and types can be changed.

<figure><img src="/files/XfxcPSCOdRi4BoPgxKp4" alt=""><figcaption><p>Custom variables can be edited</p></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.flatredball.com/gum/gum-tool/variables/add-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.
