Global Variables (15 min)
Completion requirements
01 Getting Started
This tutorial covers global variables, including:
- Global variables overview.
- Adding variables.
- Usage examples.
02 Overview
Variables are hidden inputs where you can store data that is not visible to end users. Global variables are available across your whole project. Setting your variables on the correct level is essential to ensure that they affect the correct elements.
Note: When working with variables, enable debug mode to review how the variables are being passed.
Note: When working with variables, enable debug mode to review how the variables are being passed.
03 Adding Variables
1. Click the Project Settings gear icon.

2. Select the Tools tab and click the Custom Variables gear icon.

There are two kinds of variables: system and static.
System variables are values set at the operating system level and can be accessed by various programs and processes running on the system. They provide information about the system's environment and configuration. You cannot assign a value to a system variable.

Static Variables affect elements from Salesforce, project elements, or other variables. You can set a specific value for static values.

Formula fields will be covered in a later lesson, but we've provided a brief overview for you here:

2. Select the Tools tab and click the Custom Variables gear icon.

There are two kinds of variables: system and static.
System variables are values set at the operating system level and can be accessed by various programs and processes running on the system. They provide information about the system's environment and configuration. You cannot assign a value to a system variable.

Static Variables affect elements from Salesforce, project elements, or other variables. You can set a specific value for static values.

Formula fields will be covered in a later lesson, but we've provided a brief overview for you here:
- A numeric variable is used to create dynamic calculations and store them, send them via email, or push them to Salesforce.
- A text variable performs dynamic manipulations using text inputs and fields from Salesforce and stores them, sends them via email, or pushes them to Salesforce.
- A custom JS variable is fully customized and holds a JS code.
04 Global Variable Example
Smart V is an excellent example of a global variable. Enabling Smart V for your projects essentially creates a global variable for your project, as it can be accessed from any page in the project.
When configuring on-click actions for interactive elements, you can choose to affect your global variables by setting a value.

Global variables can be used when assigning a value from page to page. For example, an action from a second project page can be passed to the first page.
When configuring on-click actions for interactive elements, you can choose to affect your global variables by setting a value.

Global variables can be used when assigning a value from page to page. For example, an action from a second project page can be passed to the first page.
05 Running Conditions on Variables
When creating a condition for a global variable, it is important to remember that this action will be applied no matter where the user is in the project. If you only want an action to run when a user is on a specific page, it is best to work with page-level variables.
If you would like to apply a condition to your variable:
1. Navigate to the Custom Variables window and click Conditions.

2. Double-click the condition to configure your condition parameters.

If you would like to apply a condition to your variable:
1. Navigate to the Custom Variables window and click Conditions.

2. Double-click the condition to configure your condition parameters.
