Get Global Variable

Fetch the value of a global variable and populate a local argument
Get Global Variable Dialog
Get Global Variable Dialog
You can access the value of persisted non-user globals without this sub-action by wrapping the name with ~
For example, ~myPersistedGlobalVariable~
Read more in Guide > Variables

Parameters

Source
Select
Default:
Global

Select the source type for the global variable

ValueDescription
Global

Fetch any general global variable (non user variable)

User (redeemer)

Fetch a user global for the user who activated the currently executing action

User (target)

Fetch a user global for the user found in the targetUser argument
Commonly used in conjunction with the Get User Info for Target sub-action

Persisted
Toggle
Default:
Persisted

Toggle between Persisted and Non-Persisted variables

Ensure you select the correct datastore (persisted or non-persisted) for the variable you are trying to get or set
ValueDescription
Persisted

These variables persist across Streamer.bot restarts

Non-Persisted

These variables should be considered temporary and will be wiped at shutdown

Variable Name
Text required

Enter the name of the global variable you would like to fetch

This is the name of the global variable, which means it should not be wrapped in % symbols unless you specifically want to use the value of a local variable in the name of your global variable
Destination Variable
Text required

Enter the name of the local argument you would like to populate

It is recommended to use a different name than the global variable name
This is the name of the destination variable, which means it should not be wrapped in % symbols unless you specifically want to use the value of a local variable in the name of your destination variable
Default Value
Text

Optionally set a default value

This will create the global variable if it does not exist and then set it to the given value

Variables

NameTypeDescription
 

The variable name and type will be depend on the parameters you selected

 
Variables generated by all triggers and available within all action executions.

C# Usage

public T GetGlobalVar<T>(string varName, bool persisted = true)
Read more in API > C# > Methods > Core > Globals > Get Global Var