# Set Variable

This action allowed you to set the value of a custom variable. This can be done using options, other variables, or via pre-set values.&#x20;

{% hint style="info" %}
Check the \[[data-storage](https://botghost.com/docs/~/changes/zT1fjHAwQ21lXOKdCcfT/data-storage "mention")]\(../../data-storage/data-storage) page on how to create a Custom Variable!
{% endhint %}

## Set Variable

## Custom Variable

From the drop-down menu, you can choose the variable you want to set the value of. Want to create a custom variable? See [data-storage](https://botghost.com/docs/~/changes/zT1fjHAwQ21lXOKdCcfT/data-storage "mention").

<figure><img src="https://1937909199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lm_hW5MApY3J0lRhi0M%2Fuploads%2F2rBWk9BNEcYtzILPbPG2%2F30358B6F-7D02-49C7-8A06-2ACFFAAF0FBC.jpeg?alt=media&#x26;token=97f47718-766d-423e-a8c6-43e786e9a0f7" alt=""><figcaption></figcaption></figure>

### User Target

If using a user variable you can choose who the value applies too.<br>

| Action                    | Response                                                                                                                                              |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| User who used the command | Applies the value of the Set Variable action to the executor of the command.                                                                          |
| User option               | Applies the value of the Set Variable action to the User Option within the command. You can use option variables, but also normal variables for this. |
| User ID                   | Applies the value of the Set Variable action to the user by using the User's Discord ID.                                                              |

## Value

You can use this to set the value of a variable. This can be used later to recall stored information. To view the value of the variable, replace 'variable' in {BGVAR\_variable} with the variable name.

<figure><img src="https://1937909199-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lm_hW5MApY3J0lRhi0M%2Fuploads%2FfXcDQmWzndUTWIOKsZ16%2FDA2634F4-DAAC-49FA-8527-80D6F4264D4F.jpeg?alt=media&#x26;token=acf59d38-c8c5-4ed9-acc0-8f181b84f704" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**You can utilize other variables in the value box.**
{% endhint %}
