Skip to main content

Global Variable

Published 31 Jul 2026

Change a variable's value when an alert fires. This is how you build death counters, running totals, on-air flags and anything else that has to remember a number or a word between events.

What You Need

  • At least one variable created on the Variables page.

Quick Start

  1. Create or edit an alert.
  2. Add the Global Variable action. It is under Variables & Timers.
  3. Choose the Variable you want to change.
  4. Choose an Operation.
  5. Enter a Value if the operation needs one.
  6. Save and test.

Configuration Options

SettingDescription
VariableWhich variable to change. The list comes from your Variables page.
OperationWhat to do to it. See the table below.
ValueThe number or text to use. Accepts placeholders such as {{ value }}. Hidden when the operation is Toggle.

Operations

OperationWhat it doesVariable type
Set ValueReplaces the value completely.Any
Add (Number)Adds your value to the current one.Number
Subtract (Number)Takes your value away.Number
Multiply (Number)Multiplies the current value.Number
Divide (Number)Divides the current value.Number
Append (String)Adds your text to the end of the current text.Text
Toggle (Boolean)Flips between true and false. No value needed.True/False
Countdown timers are separate

Countdown variables are controlled by the Countdown Timer action, not this one.


Common Uses

Death counter

  • Trigger: whatever marks a death, for example a chat command or a channel point redemption
  • Operation: Add (Number)
  • Value: 1

Show it on stream with a Text widget containing {{ var.death_count }}.

Running donation total

  • Trigger: any tip
  • Operation: Add (Number)
  • Value: {{ value }}

Current song

  • Trigger: Spotify, Song Request Started Playing
  • Operation: Set Value
  • Value: {{ track_name }} by {{ artist_name }}

On-air flag

  • Trigger: OBS Studio, Stream Started
  • Operation: Set Value
  • Value: true

Then use a second alert triggered by TipLink Variables to react when that flag changes.

Resetting at the start of a stream

There is no dedicated reset. Use Set Value with your starting number, on an alert you trigger manually or from your "stream started" event.


Using the New Value

The variable updates immediately, so any later action in the same alert can read it with {{ var.name }}.

That's death number {{ var.death_count }} today!
Actions must run in order

If your alert has Execute All Actions At Once turned on, a later action may read the old value, because everything starts at the same time. Turn it off when one action depends on another.


Triggering an Alert When a Variable Changes

A change made by this action can itself trigger another alert. Choose TipLink Variables as the platform and Variable Value Changed as the event. See Variables.

Watch out for loops

If an alert is triggered by a variable changing, and one of its own actions changes that same variable, it will trigger itself over and over. Point the action at a different variable, or add a condition so it can only match once.


Troubleshooting

The variable did not change

Check the variable type matches the operation. Adding to a Text variable, or appending to a Number, will not work.

A placeholder came out blank

Open the event on the Activity page and confirm the field name. The Placeholder Picker is the safest way to insert one.

The value looks wrong after maths

Dividing by zero leaves the value unchanged. Non-numeric text passed to a number operation is ignored.