Set Global Variable
Create or update the value of a global variable

Set Global Variable Dialog
Parameters
Destination
Select
Default:
Global
Select the destination type for the global variable
| Value | Description |
|---|---|
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 |
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
| Value | Description |
|---|---|
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 variableValue
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 valueIncrement- Enter anyintto be added to the existing valueDecrement- Enter anyintto 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 0Variables
| Name | Type | Description |
|---|---|---|
| No data | ||
C# Usage
public void SetGlobalVar(string varName, object value, bool persisted = true)