Variables

Variables are used in the experience to control the various activities of elements and scenes through rules. But these variables are local and cannot be used for different experiences of the same organization.

Adding Variables in an experience

  • Choose the variables you want to add.
  • Add the variable by clicking on Add Variable Button in the variables tab.

Variables can also be tracked by enabling the "track" option for each variable. The information about this can then be viewed in analytics.

Global Variables

Global Variables remain same for the entire organization's different experiences.

Experience settings globalvariables

Defining Global Variables

  • Click on Define Global Variables in the Variables tab.

define global variables

  • Add the global variables by clicking on Add Variable button.

Adding Global Variables in the experience

  • Choose the variables you want to add.
  • Click on Add Global Variables button in the Variables Tab.

Using Global Variables in an experience

  • Add Global Variables to your experience by referring to Adding Global Variables.
  • Add a TextBox by clicking on the + icon.
  • Put the Global Variable you want to use in the text in double curly brackets: {{GLOBAL_VAR}}.

gvars

  • Add a Rule: Change the value of {{GLOBAL_VAR}} to (let say "Global variables") after clicking on any element.

gvars rule

  • Deploy the experience using authentication as non-public.

To check persistance of Global Variables

After performing the above steps, do the steps as follows:

  • Create a new experience and add the Global Variable (GLOBAL_VAR) to that Experience.
  • Add a TextBox by clicking on the + icon.
  • Put the Global Variable you want to use in the text in double curly brackets: {{GLOBAL_VAR}}.

After deploying the experience, it will be noticed that the GLOBAL_VAR contains the new value ("Global Variables") and not the value with which the GLOBAL_VAR was initialized.

Auto-generated Variables

Auto-generated variables are generated automatically when a user creates an experience. There are 2 types of auto-generated variables - v_identifier_var and v_platform. These variables obtain the session data of anybody who uses the live experience, for example name or uuid, which can be later viewed in the analytics of the experience.

These variables are immutable and cannot be changed in value.

User Variables

A user creating an experience can also make their own variables. These can be used while creating rules between elements or scenes.

These variables can be added in various parts of a scene, such as a string value which changes after a certain action, or a score box. User variables can also be used for logic functions which are hidden on the outside, for example to change an element after a variable reaches a certain value.

Using Variables in an experience

  • Add a TextBox by clicking on the + icon.
  • Put the variable you want to use in the text in double curly brackets: {{VAR}}.

variables

  • Add a Rule: Change the value of VAR to (let say "Gmetri") after clicking on any element.

Rule