Bitfocus AS
Bitfocus AS

Loading...

Footer

Bitfocus

Subscribe to our newsletter

The latest news, articles, and resources, sent to your inbox.

FacebookInstagramGitHubYouTubeLinkedIn

Products

  • Buttons
  • Companion

Integrations

  • Supported Devices
  • Developer Community
  • Connection Development

Support

  • Support Overview
  • Documentation
  • Video Tutorials
  • Community Forum

Sales

  • Resellers & Integrators
  • Buttons Pricing

Updates

  • Case Studies
  • Events & Trade Shows
  • Press Releases
  • Product Updates
  • Webinars

Legal

  • Legal Overview
  • Privacy Policy
  • Buttons EULA
  • Terms & Cookie Policy

Company

  • About us
  • Press kit
  • Careers
Co-funded by the European Union

Our Bitfocus Workflow 2.0 project is co-funded by the European Union’s Creative Europe programme. About the project

© 2026 Bitfocus AS. All rights reserved.

Use variables
Docs for
Overview
Getting started
What is Bitfocus Buttons?
Install Buttons and get started
Manage your Buttons license
Activate Buttons offline
Find your way around Buttons
Create your first backup
Add an ATEM connection
Choose a control method
Choose an installation path
Install Buttons on Debian or Ubuntu
Understand HA clustering
High Availability
Upgrade Buttons
Remove Buttons
Positions
Understand positions
Encoders and taps
Create a position
Custom button layouts
Add controls and sections to a position
Feedback variables with text
Create your first button
Use a connection's presets
Build more capable button actions
Encoders
Add more feedback to a button
Organize controls in a section
Shift Section
Organize controls with a Folder Section
Add a Popover Section
Build and reuse a Shared Section
Show different controls by role
Choose a routing panel
Build a Router Section
Understand Custom Routers
Custom Router panel
Surfaces
Surface compatibility
Add and attach a surface
Device orientation
Connections
Update a connection's module safely
Monitor and troubleshoot a connection
Port forwarding (HA)
Router integrations
VideoHub and AJA KUMO
Utah Scientific BPS
Generic SW-P-08
Nevion VideoIPath
Arkona BLADE//runner
Evertz Quartz
Imagine LRC
Riedel MediorNet
Nevion MRP
Ross Video NK router
TAG Video Systems MCS
Routing
Physical routing
Shape direction
Configure ports and labels
Take a physical route
Understand route status
Topology graph
Routing Presets
Get started with virtual routing
Configure Nested Shapes
Reverse routing
Tielines
Routing Projects
Routing settings
Troubleshoot a route
Tally
Understand the Tally system
Send ATEM tally and labels to a UMD
Interpret Active Tally state
TSL/UMD connections
Diagnose tally problems
NMOS
Understand NMOS in Buttons
Connect Buttons to an NMOS Registry
Built-in Registry Server
Configure NMOS connections
Discover and adopt
Browse the NMOS inventory
Manage NMOS multicast addresses
Diagnose NMOS problems
Cuelists
Understand Cuelists
Run and stop cues
Build a Cuelist
Cuelist state
Read and advance a running Cuelist
Control a Cuelist from a Position
Workflows
Understand workflows
Build your first workflow
Encoders
Reuse a group of workflow nodes safely
Port forwarding (HA)
Troubleshoot a workflow
Recipes
Sequence a timed automation
Call an HTTP endpoint from a workflow
REST endpoint
Use variables
Understand variable scope
Understand nested variables
Update expressions for v1.8
Plan and use Tags
Access
Create and manage users
Create roles and assign permissions
Grant access to specific resources
Set up PIN and NFC sign-in
SSO
Get started with SSO
Connect a generic OIDC provider
Connect LDAP or Active Directory
Map identity claims to roles
Secure a Buttons deployment
Integrations
External control
Connect to Bitfocus Listener
USB Relay
Install USB Relay on Windows
Install USB Relay on macOS
Desktop app
Install USB Relay on Linux
Install USB Relay on a Raspberry Pi
Get started with the Control API
Secure and monitor the Control API
Control API reference
AI assistants (MCP)
Connect an AI assistant
Edit with an assistant in the editor
What an assistant can do
Manage MCP access and tokens
Actions
HTTP replies
Administration
Enable and manage installable features
Services and health
Configure and monitor scheduled backups
Restore a backup and verify it
Export or import Buttons configuration
Store and rotate connection secrets
Replace the HTTPS certificate
HA backup and recovery
Settings
Collect support information
Reference
Glossary
Button Inspector reference
Network ports reference
Expressions
Internal actions reference
Custom Router button types
Startup configuration reference
Workflow nodes
Connection workflow nodes
Workflow variable and action nodes
Internal workflow nodes
Position workflow nodes
API workflow nodes
Utility workflow nodes

Loading...

Previous
← REST endpoint
Next
Understand variable scope →
Contact support →
You are viewing documentation for Buttons 1.10.See the docs for Buttons 1.8
Buttons/Variables/Use variables

Use variables

View as Markdown
Once you understand where a variable is visible, using one is the same everywhere in Buttons: browse for it, insert it, and optionally transform it with an expression.

Before you begin#

  • A variable already defined, see the scope-specific steps below if you haven't created one yet.

Create a Self or Parent variable#

  1. Select the button or section that should hold the variable.
  2. In the inspector, open its Variables tab.
  3. Select + next to Self to add a variable that only this element can see, or next to Parent to add one to the section this element sits in, shared by everything directly inside that section. The Parent heading names that section.
  4. In Add Variable, enter a Name, an optional Description, and a Type, then select Create.
  5. Enter an Initial value for the new variable, then select Apply.
Each variable shows the reference to use it by, such as $(self.state.camera), next to its name.

Create a Position Variable#

  1. Open the position's Configuration tab and find Position Variables, or open any element's Variables tab and use its Position group.
  2. Select +.
  3. Enter a Name and an optional Description, and choose a Type: Boolean, Connection, Feedback, Number, Routing Endpoint, or String. For Connection, also choose the Connection Type (Module) the variable may point to.
  1. Select Create, then set its Initial value for this position and select Apply. Each position that uses this variable needs its own value set independently.
To use a Position Variable to swap which connection a control targets, set its type to Connection, then use the Set Position Variable Internal Action on a button to change it at runtime.

Create a Workflow Variable#

  1. Open Workflow, and open or create a Workflow.
  2. Drag a Workflow Variable node from the node pool onto the canvas. The Create Variable dialog opens.
  3. Give it a Variable Key: this is the individual variable's own key, separate from the Workflow's own Variable Key (which defaults to the Workflow's name and is used for other purposes on the Workflow itself).
  4. Set Type: String, Number, or Boolean.
  5. Set an Initial Value, or turn on Persist Value to keep the variable's current value across a restart instead of resetting to its initial value.
  1. Select the check mark to create the node, then select Apply on the workflow.
Change its value from anywhere using the Set Workflow Variable Internal Action.

Find and insert a variable#

Most text fields in the inspector have a small folder icon at the end. Selecting it opens the field in an editor with Browse Variables underneath. Variables are grouped into folders: self, parent, position, time, then one folder per connection (named by its Variable Key) and one per Workflow. The number on a folder is how many variables it holds. A folder without a number, such as a connection or Workflow with no variables, has nothing to insert.
Open a folder and select a variable to insert it, then select Done.

Include the connection's prefix#

A connection variable's full name starts with that connection's Variable Key (set on the connection's Config tab), then a dot, then the variable's own name. If you leave the prefix out, Buttons can't tell which connection you mean, and the reference doesn't work.
For a connection whose Variable Key is ATEM:
Write this
Not this
$(ATEM.pgm1_usk_1_onAir)
$(pgm1_usk_1_onAir)
$(ATEM.device_ip)
$(device_ip)
The same applies inside an expression. An expression that's true while upstream key 1 is on air on M/E 1 is written as:
$(ATEM.pgm1_usk_1_onAir) == true
If you rename a connection's Variable Key, for example from ATEM to StudioA, every reference has to use the new prefix: $(StudioA.pgm1_usk_1_onAir).

Tip

Pick variables from the variable browser or the expression editor's suggestions rather than typing them. Both insert the full name, prefix included.

Transform a variable with an expression#

When a variable's raw value isn't quite what you need, use an expression instead of the variable directly:
  1. Open the expression editor from the same field you'd insert a variable into.
  2. Reference the variable inside the expression, and combine it with functions as needed. For example, concat combines several strings and variables into one value.
The expression editor suggests available functions and variables as you type, so you don't need to remember exact syntax.

If you get stuck#

What you see
What to try
Two variables seem to conflict, or one shows the wrong value.
Check their scope: a Self variable in one element and an identically-named Self variable in another are never actually the same variable.
A Position Variable shows a different value than you expect.
Confirm you're looking at the right position: the definition is shared, but each position holds its own independent value.
A Workflow Variable resets after a restart when you expected it to keep its value.
Turn on Persist Value for that variable.
An expression fails with an error such as Unexpected token, or a condition always takes its Else branch.
Check that every connection variable includes its prefix: $(ATEM.pgm1_usk_1_onAir), not $(pgm1_usk_1_onAir). The error doesn't name the variable, so check each $(…) in the expression.
You can't find a variable you know exists.
Open the variable browser (the folder icon) and check under the scope you expect it in: Self and Parent variables only appear while you're inside the right element.

Where to go next#

  • Understand variable scope.
  • Understand nested variables.
  • Expression functions and operators reference.

Was this helpful?

Was this helpful?

0 of 0 users found this page helpful