Creating Global Variables
Updated
This articles provides information about permissions accessing the Global Variables page on Sprinklr and creating Global Variables. It also provides information on use of the Global Variables in the IVR, ACW, Journey Workflows.
You can create and edit Global Variables using the Create Global Variable page.
Permissions
The following permissions are required to create Global Variables. To navigate to the permissions page,
From the Sprinklr home page, navigate to your profile.
Click Permission tab. From the left navigation pane, navigate to Setup.
In the Setup section, navigate to Global Field to grant create, edit, delete, and view Global Variables.
Accessing Global Variables
On the Launchpad, select the Sprinklr Service tab. From the Platform Modules section, under Settings, click All Settings.
In the left navigation pane, under General, click General Settings.
In the General Settings page, click Global Variables from the left navigation pane.
Creating Global Variables
On the Global Variables page, click +Create Global Variables. The Create Global Variable page appears.
From the Field Type field, select the supported variable types. These types cover common use cases, and future iterations will support additional complex data types like key-value maps and dynamic values.
Text (Constant String) - A fixed text value that allows you to add combination of letters and numbers (example, Gold Tier)
Number (Constant Number) - A fixed numeric value that allows you to add any combination of numbers (example, 50 (max attempts), 72 (SLA hours))
Text Multi (List) - A list of strings (example, ["US", "CA", "UK"] (country codes))
In the Name field, enter a descriptive name for the variable.
In the API Reference ID, provide a unique identified for API use. This value must be unique.
In the Description field, enter a brief description for the variable. This is optional.
In the Variable Value field, input the value the variable should hold. You can add multiple values in this field.
Click Create.
Using Global Variables in the Workflows
Global Variables can be accessed across all workflows, including:
Guided Workflows
Conversational AI
IVR
ACW (After Call Workflows)
Journey
There is no need to manually import Global Variables into individual workflows. Once defined, they are immediately usable wherever needed.
These Global Variables will be available in the All Resources section from where you can fetch the variables by their names. You can use these Global Variables while creating the workflows. The Global Variables is listed under Entity Based Resources.
Real-world use case of Global Variable in AirLines
Customer Code to Category Mapping
A retail brand categorizes its customers into segments based on an internal customer code fetched via API:
A1 → *Advanced*
B2 → *Basic*
C3 → *Premium*
However, agents don’t understand codes like "A1" or "B2". They need to see the familiar category name. Example, "Advanced" or "Premium".
If this code-to-name mapping is implemented directly inside each workflow:
It has to be duplicated in every workflow (IVR, Guided Workflow, etc.)
Any change (example, renaming "Advanced" to "Gold Tier") must be reflected everywhere manually
Why Global Variables Are Needed
Global Variables solve this problem by acting as a centralized data reference.
Instead of:
groovy
if (customerCode == 'A1') return 'Advanced'
Workflows can simply look up a Global Variable:
groovy
return globalVariables.customerCodeMap[customerCode]
Now, the mapping { "A1": "Advanced", "B2": "Basic", "C3": "Premium" } is defined once in the Global Variables configuration, and used everywhere.