Set Global Variable

Create or update a global variable
Read more in Guide > Variables.

Parameters

Destinationrequired
Select
default:Global

Select the destination type for the global variable

  • Global - Set a general global variable (non user variable)
  • User (redeemer) - Set a user global for the current user who activated the action
  • User (target) - Set a user global for the targetUser
Persisted
Toggle
default:true

Toggle between Persisted and Non-Persisted variables

  • Persisted - These variables persist across Streamer.bot restarts
  • Non-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 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 argument
  • Value - Assign any arbitrary value
  • Increment - Add to an existing int variable
  • Decrement - Subtract from an existing int 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 variable
  • Value - Enter any value
  • Increment - Enter any int
  • Decrement - Enter any int

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)