How can I preserve text variables when I copy slides or text entry fields?

May 15, 2024

Hi there,

I am creating a simulated UI login experience. I reuse two text variables (username and password) across multiple slides within this login scenario. However, every time I try to copy a text entry field (or copy a slide containing a text entry field), the text variable is reset to a default variable created by Storyline, e.g., "TextEntry1."

Is there any way to preserve the variable assigned to a text entry field when it is copied to a new slide? I am spending a lot of time reassigning variables, and it opens up the possibility of breaking the scene's logic if I miss one.

Many thanks,

Peter

3 Replies
Judy Nollet

When you insert, copy, or duplicate a data-entry field (text or numerical), the program automatically creates a variable to store what's entered in that field. The entry is known as the variable's value

It sounds like you want to display the value of your username and password text-entry fields. To do that, you insert a reference to the variable within a standard text box or shape.

There are two ways to do that: 

  • Type the name of the variable between percentage signs. For example: %username%
  • Go to the INSERT ribbon, click Reference, and select the variable.

When you insert a variable reference, it will have yellow highlighting around it when you're editing in Storyline. That's there to make it obvious it's a reference (and not just text). The highlighting won't appear when the slide is previewed or published.

As you noted, Storyline assigns default names. I suggest you give every variable a meaningful name.

Peter Herring

Hi Judy,

Thank you for such a detailed reply. In this instance, though, I do not think a reference to the variable will work. I am trying to simulate the login experience of being able to click freely between the Username and Password text boxes, so I am reusing the variables themselves to ensure that the student can continue to enter and edit the username and password on each slide in the simulation.

For example, if the student presses Enter when they input the incorrect password, it will bring up a new slide that shows the UI's login error screen, and they'll be able to alter the value in the password text box to meet the necessary conditions to proceed. Another example is that each password entry slide has both "hide" and "reveal" layers that use the same text variable to toggle visibility. I use copy-pasting a lot to preserve any hotspots, objects, or triggers that appear in multiple locations, but each time I'm having to reassign the correct text variable to these text entry fields.

It sounds like there is no way for Storyline to carry forward the variables assigned to text or numeric entry fields if you copy them into a new slide or layer, which is definitely an inconvenience.

Thanks again for your help.