Set Global Variable

Create or update the value of a global variable
Set Global Variable Dialog
Set Global Variable Dialog
This does not also make the global variable's value available in your action
To access the value of a global variable in your action, you must first assign it to a local variable with the Get Global Variable sub-action
Read more in Guide > Variables

Parameters

Destination
Select
Default:
Global

Select the destination type for the global variable

ValueDescription
Global

Set a general global variable (non user variable)

User (redeemer)

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

User (target)

Set 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 create or update

Variable Name 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 as the name of your global variable
Value
Text required

Enter the value to assign to the global variable, depending on the selected type in the dropdown

All options support parsing of %arguments%

  • Value - Enter any value
  • Increment - Enter any int to be added to the existing value
  • Decrement - Enter any int to be subtracted from the existing value
If left empty, Increment and Decrement default to 1. If the global variable did not already exist, it will add or subtract from 0

Variables

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

C# Usage

public void SetGlobalVar(string varName, object value, bool persisted = true)
Read more in API > C# > Methods > Core > Globals > Set Global Var