Forum Discussion
Issue with text variable as triggering event
I'm setting up a software simulation as a template for future training. The template makes use of slide masters. I've used javascript to create a dropdown menu on the slide layer and set a text variable to whatever option the user selects.
On a regular slide, I tried to create a trigger of the form "Resume timeline on this slide when the variable $VariableName changes if $VariableName = ExpectedValue." Although I can verify that the variable's value changes as expected, the trigger never runs. If I remove the conditional, it runs as soon as the variable changes. If I use a number variable instead of a text variable, I can use the conditional.
Is this a known issue with text variables?
It turned out to be a complex issue, mainly because the way the Storyline engine handles variable‑based triggers is not always predictable in this scenario. The dropdown script was running on the master slide, which means it executed globally and updated the variable correctly. However, the trigger “Resume timeline when variable changes if variable = ExpectedValue” was defined on a specific slide.
The complication is that Storyline doesn’t always synchronize variable changes made on the master with conditional triggers on individual slides. In practice, the slide may pause at the beginning and only resume if it detects the variable change while its own trigger engine is actively listening. That mismatch in timing is why the original menu sometimes failed to resume the timeline, even though the variable itself was updated. You already confirmed that Storyline’s trigger engine evaluates numeric conditions more predictably than text conditions, which explains why using number variables works more reliably than text in conditional triggers.
By simplifying the menu (hard‑coded options instead of pulling from a textbox) and ensuring the variable change occurs while the specific slide is active, the trigger now fires reliably.
In short: the fix was to simplify the menu construction and remove the dependency on a textbox, because Storyline’s trigger engine is sensitive to timing and exact string matching. Using hard‑coded options and, where possible, numeric variables ensures the resume trigger behaves as expected.
7 Replies
- PhilMayorSuper Hero
Should work, any errors on the console? Is it case sensitive?
- AlexKeeneCommunity Member
I know I left a reply earlier but I can't find it now.
It's not a case/spelling/punctuation issue; I've copied the expected value out of the dropdown menu to double-check that.
I think all of my console errors are related to javascript stuff, not this trigger. I'm certainly not an expert in that field, so I took a screenshot.
I uploaded a (heavily redacted/simplified) version of the slide in response to Nedim above. - AlexKeeneCommunity Member
I've double-checked the spelling, spacing/punctuation, etc. — even gone so far as to copy the expected value directly from the drop-down menu that sets the variable to ensure it's correct.
As far as the console is concerned: yes, there are some errors, but from what I can tell, they're connected to the javascript generating the drop-down menus. JS/console debugging is a new skill for me, so screenshot included in case I'm misunderstanding — but nothing here looks like my variable or its possible values.
- NedimCommunity Member
I tried to replicate your scenario and did not encounter any issues with the conditional statement as described in your post. Below is my simple setup. If you need help troubleshooting your specific case, please upload a slide with your example. If it’s more complex, we can take a closer look and figure out a solution.
- AlexKeeneCommunity Member
See attached. The only substantive differences are:
- The object manipulating the variable is located on a slide master instead of the main slide.
- The variable is being adjusted by Javascript and not directly by a trigger.
- NedimCommunity Member
It turned out to be a complex issue, mainly because the way the Storyline engine handles variable‑based triggers is not always predictable in this scenario. The dropdown script was running on the master slide, which means it executed globally and updated the variable correctly. However, the trigger “Resume timeline when variable changes if variable = ExpectedValue” was defined on a specific slide.
The complication is that Storyline doesn’t always synchronize variable changes made on the master with conditional triggers on individual slides. In practice, the slide may pause at the beginning and only resume if it detects the variable change while its own trigger engine is actively listening. That mismatch in timing is why the original menu sometimes failed to resume the timeline, even though the variable itself was updated. You already confirmed that Storyline’s trigger engine evaluates numeric conditions more predictably than text conditions, which explains why using number variables works more reliably than text in conditional triggers.
By simplifying the menu (hard‑coded options instead of pulling from a textbox) and ensuring the variable change occurs while the specific slide is active, the trigger now fires reliably.
In short: the fix was to simplify the menu construction and remove the dependency on a textbox, because Storyline’s trigger engine is sensitive to timing and exact string matching. Using hard‑coded options and, where possible, numeric variables ensures the resume trigger behaves as expected.
Related Content
- 9 months ago
- 2 months ago