Set Global Variable
Create or update a global variable
Preview
Parameters
Sourcerequired
Select
default:
Global
Global
- Fetch any general global variable (non user variables)User (redeemer)
- Fetch a user global for the current user who activated the actionUser (target)
- Fetch a user global for thetargetUser
- Used in conjunction with the Get User Info for Target sub-action
Persisted
Toggle
default:
true
Toggle between Persisted
and Non-Persisted
variables
Persisted
- These variables persist across Streamer.bot restartsNon-Persisted
- These variables should be considered temporary and will be wiped at shutdown
Ensure you select the correct datastore (persisted or non-persisted) for the variable you are trying to get or set
Variable Namerequired
Text
Enter the name of the variable you would like to create or modify
Variable Name
must be entered in camelCase
(the first letter must be lowercase)Sourcerequired
Select
default:
Argument
Select the source for the value to assign to the global variable
Argument
- Use the value of an argumentValue
- Assign any arbitrary valueIncrement
- Add to an existingint
variableDecrement
- Subtract from an existingint
variable
Valuerequired
Text
Enter the value to assign to the global variable, depends on the selected Source
type, detailed above
Argument
- Enter the name of an existing argument to assign its value to the global variableValue
- Enter any valueIncrement
- Enter anyint
Decrement
- Enter anyint
Variables
This sub-action does not populate any variables.
C# Usage
Set the value for a global variable
public void SetGlobalVar(string varName, object value, bool persisted = true)