Variables - Between scenes

Jul 22, 2020

Hi,

I have two scenes in my articulate project.

The first scene has text variable, wherein a user has to enter his/her name.

However, when I go to next scene, the REFERENCE of that variable doesn't work. 

Do I need to add a fresh text variable for next scene?

3 Replies
Judy Nollet

A variable applies to the entire course, so you don't have to create a new one for each scene. 

It's hard to tell what's wrong without seeing the file. Best guess: the Reference is "misspelled." Double-check that the text has the variable name sandwiched by percent signs (e.g., "%Name%). 

  • You can test this by temporarily putting a text box with just the variable reference on the slide where the user enters their name. If the reference works there, copy and paste it to the next scene.
Andrew Blemings

Variable references can be a bit wonky in their own ways. For one, I've found that not all variable references get parsed into the variable's value at runtime. I think the default text for text input boxes is one such place, so the element the reference is in may be a factor.

Something else I've found is that variable references in slides should only be typed after the variable has been declared/created in Storyline. I think what happens is that when we add text to a text box and deselect the box, Storyline parses the text and checks for references against its known variables. And that makes sense, because how else would it know if what we entered was pure text or if it's something Storyline needs to actually process. If the variable itself hasn't been created yet, Storyline seems to simply treat the reference as pure text, %s and all, and I think we understand why that makes sense.

Two workarounds I've found:

  1. Try to declare variables in Storyline before referencing them in text on a slide where possible. If a reference to a variable was made before the variable, simply remove one of the characters in the reference text, deselect the text box (to let it "reset"), retype the missing character, and then when you deselect the reference should find the variable this time. Nothing will change visually to indicate this in the editor, but it should be apparent when you preview the course.
  2. The other "workaround" I've found is simply to incompletely pre-type variables. If you're like me, you'll create a slide and start populating variables as you lay out the elements. I'll usually leave off the last % of each variable per the first list item above. Then I'll sweep through and declare all the variables needed for the slide, and then I'll go back and add all the ending %s to the references so that each of them can now "find" their respective variables.

Hope that helps

This discussion is closed. You can start a new discussion or contact Articulate Support.