Follow

How do I set a custom variable?

In order for a variable to exist it must be contained within an Action. If the Action that contains the variable is deleted, the variable will cease to exist. 
 

To set a variable with element interactions:

  1. Select an element.
  2. From the Interaction tab, click the Actions button.
  3. Select Set VariableThe Element Interaction panel will open.
  4. Select a Trigger.
  5. Set a Delay time, if desired. 
  6. The Variable will be set to New Variable by default. 
  7. Give the variable a Name.
  8. Choose a Type. See Type options below.
  9. Select Fire Once if you want to make sure that the variable set only happens the first time a user interacts with this element. This saves having to track variables that are used to determine if all the buttons on a page have been clicked.
  10. Input Conditions you wish to evaluate, if any, that are met before the variable can be set.
  11. Click Apply to commit your changes.
  12. Click Preview to preview the variable or Done to complete.
 
 

To set a variable with page timings:

  1. Select an element.
  2. From the Animate tab, click the Timing button.
  3. Select Set VariableThe Element Interaction panel will open.
  4. Select a Trigger.
  5. Set a Delay time, if desired. 
  6. The Variable will be set to New Variable by default. 
  7. Give the variable a Name.
  8. Choose a Type. See Type options below.
  9. Select Fire Once if you want to make sure that the variable set only happens the first time a user interacts with this element. This saves having to track variables that are used to determine if all the buttons on a page have been clicked.
  10. Input Conditions you wish to evaluate, if any, that are met before the variable can be set.
  11. Click Apply to commit your changes.
  12. Click Preview to preview the variable or Done to complete.
 
Note: You will know that an element has a set variable when you see an ( x ) symbol next to it. 

Type Options:


Number: Requires selection of an Operator (=, +=, -=)

String: Requires input of Value.
Note: When setting a variable to a string there is no need to surround the text with quotes unless you're doing string manipulation. Example : {{dki.course.title}} + " : " +{{dki.course.description}}.

True/False Boolean: Requires selection of a Value of True or False. 
 
 
For examples of operators you can use in the Conditions field, see: JavaScript Operators by w3schools.com
 
 
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments