> For the complete documentation index, see [llms.txt](https://docs.uniot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uniot.io/platform/sandbox/visual-editor/variables.md).

# Variables

Variables store and manage data in your scripts. Use variables to track changing values like sensor readings, counters, states, or calculated results.

{% hint style="info" %}
Create variables through the Variables section in the toolbox before using them. Variable names are case-sensitive - choose meaningful names to make your code easier to understand.
{% endhint %}

## set

<div align="left"><figure><img src="/files/rQ4Jgrok6bhoGyZE75sT" alt=""><figcaption></figcaption></figure></div>

Assigns a value to a variable. If the variable doesn't exist, it's created automatically.

**Parameters:**

* **Variable**: Select from the dropdown or create a new variable
* **Value** (Any): The value to store

**Example:**

<figure><img src="/files/WKJzri80OSx6BnxKUZJd" alt=""><figcaption><p>Setting variables</p></figcaption></figure>

## get

<div align="left"><figure><img src="/files/qZMjTT9XPA0apdePU6Q4" alt=""><figcaption></figcaption></figure></div>

Retrieves the current value stored in a variable.

**Parameters:**

* **Variable**: Select which variable to read

**Returns:**

* **Any**: The current value of the variable

**Example:**

<figure><img src="/files/tlw4AbdH5IOk5FEEmN3G" alt=""><figcaption><p>Getting variable values</p></figcaption></figure>

## change

<div align="left"><figure><img src="/files/12igOiFypCraHNfz1Opi" alt=""><figcaption></figcaption></figure></div>

Increments or decrements a numeric variable by adding a value to it. Use negative values to subtract.

**Parameters:**

* **Variable**: Select which variable to modify
* **Value** (Number): The amount to add (use negative for subtraction)

**Example:**

<figure><img src="/files/h9UawPepEhdxaQdwMIiQ" alt=""><figcaption><p>Modifying variables</p></figcaption></figure>

## Managing Variables

<div align="left"><figure><img src="/files/4yDPoeeWeyflI345qS6S" alt=""><figcaption></figcaption></figure></div>

The variable dropdown menu in each block provides options to:

* **Select** existing variables from your script
* **Rename** the selected variable (updates all references)
* **Delete** the selected variable (removes from all blocks)

{% hint style="warning" %}
Renaming or deleting a variable affects **all blocks** that use it. Be careful when modifying variables used in multiple places.
{% endhint %}
