Forum Discussion

JudyNollet's avatar
JudyNollet
Super Hero
1 year ago

The Value of Variables

Variables provide the real power in Storyline. Simply put, a variable stores data. That data can help you track selections, control interactions, perform calculations, and more.

 

Types of variables

Based on the type of data it holds, a variable belongs in one of three categories.

True/False variable

A True/False (T/F) variable is like an Open/Closed sign that hangs in a storefront's window. There are only two possible options: True or False.

 

Text variable

A Text variable is like a written note. Its value can contain any combination of keyboard characters.

    • It is possible to enter a number into a Text variable. However, the program sees the entry as typed characters, not as a number. Therefore, you can't do math operations with a number in a Text variable.

 

Number variable

A Number variable is like an entry in a calculator. Because the value can only be numeric, the program can perform math operations on it. For more information, see my primer about trigger calculations.

 

Variables can also be categorized as follows:

  • Project variables are created within a given .story file.
    • Many Project variables are created manually. However, when you insert a data-entry field (text entry or numeric entry), Storyline automatically creates the appropriate type of variable to hold the value entered in the field.
  • Built-in variables are used for values that might apply to any course. For example, there are built-in variables to control accessibility features, to number slides, and to track quiz results.

 

Variable values

The data stored in a variable is known as the variable's value.

  • Each variable starts with a default value. 
  • A value stays the same until a trigger adjusts it.
  • A value can be used in triggers and shown on a slide anywhere in the course.

 

Creating and accessing variables

You can create or edit variables in the Variables window. 

The button to open the Variables window is near the top of the Triggers panel.

The Variables window has separate buttons at the top for showing either the Project variables or the Built-In variables. The list displays each variable's Name, Type, Default Value, and Use Count

  • You can edit a variable's Name or Default Value.
  • Clicking the number in the Use Count column opens a window that shows were the variable is used in the course.
  • You cannot edit a variable's Type. Instead, you have to create a new variable with the desired type.

 

Displaying variable values

You can show any variable's value on a slide as a variable reference. There are two ways to enter a reference.

  • Type the name of the variable within percentage signs. For example, to show a variable called "Name," type "%Name%" where the value should be shown.

 

  • Insert a reference from the INSERT ribbon. This allows you to select a variable from the list, so you don't have to worry about misspelling the name.

 

While editing a slide, Storyline automatically highlights the reference in yellow. This makes it easy to see where you are using references. The highlighting does not appear when the slide is previewed or published.

 

Tips for working with variables

  • When you create a variable, Storyline gives it a generic name (such as “Variable1,” “TextEntry,” or “NumericEntry”). To make development and troubleshooting easier, edit each variable's name to something meaningful.

 

  • A trigger can be set to run when a variable changes. However, that kind of trigger only works when the variable changes on the same slide as the trigger.

 

  • Showing variable references helps during development and troubleshooting. It allows you to check whether the values change as expected. If the user doesn’t need to see a value, insert the reference into its own text box. Before publishing the course, delete that text box. Or, to keep it available for future use, hide it on the Timeline, or move it off the slide. If you move it off the slide, be sure to remove it from the Focus Order.

 

It's worth the effort to learn about variables.

These links lead to more info.

6 Replies

    • Ange's avatar
      Ange
      Community Member

      Fantastic as always. I miss community member portfolios, no longer available with the revamped site, where you (and many other members) had generously shared and collated your tips, tricks, troubleshooting, step-by-step, best practice, advice, examples and so much more. Thank you.

      • JudyNollet's avatar
        JudyNollet
        Super Hero

        Thanks for the kind words, Ange!

        FYI: When you go to someone's profile page, it defaults to the "Most Recent" tab, which lists their most recent activity on the site. If you switch to the "Newest Topics" tab, you'll see a  list of the posts that person has authored. So if you ever want to review the tips I've posted, that's where to look. 😁

        Yeah, that's not as nice as the way profile pages were set up on the old site. I've already submitted a feature request that they should, at the very least, change the tab names. Because "Most Recent" and "Newest Topics" sound like the same thing...

  • Hi, Judy!

    This is an excellent post🤩 Thanks for sharing with the community!

  • JoeFrancis's avatar
    JoeFrancis
    Community Member

    Well said, Judy, as always! Now, if we could just convince the powers-that-be at Articulate to add the array (list)-type variable and the object-type variable, that would open so many more doors.