Getting If Then to work with Text AND Number Variables

Aug 19, 2021

Hello!

I am trying to get a trigger to recognize when a text entry = 'blank' OR y number = 0 OR z number = 0. There is one text variable and two number variables. Oddly, whenever text is entered in its entry location, the trigger no longer works, even if y and z are are still 0. However, if I leave the text entry alone, I get it to work with both or either of the y and z being entered and text being left as 'blank'.

Any thoughts on how to get the text to also recognize that the number variable are still blank even though the text has something in it? All of the default values are blank and 0, respective to their variable type. The attachment is how the triggers are laid out currently. I have also tried using OR as mentioned above,  but it produced the same results.

  

5 Replies
Maria Costa-Stienstra

Hi, Kory.

Thank you for sharing the screenshot and the details!

I attempted to reproduce your scenario, but it's working as expected on my end. Here's my setup:

  • One text entry field
  • Two Numeric entry fields (WeightEntry and ValueEntry) with a default value of 0
  • One button
  • A rectangle with an initial state set to Hidden

I set up a trigger to change the state of the rectangle to Normal when the user clicks the button if the textEntry is blank OR ValueEntry is blank OR WeightEntry is blank:

Windows 10 (1) 2021-08-19 at 1.14.15 PM

Here is the result:

Screen Recording 2021-08-19 at 01.11.42 PM

If you can share your .story file, I'm happy to take a look!

Kory Trosclair

I will share the story file as well as a video of me testing the functionality of the first slide only to show everything working except the text entry part.

I apologize for the trigger complexity. Most of what I am trying to get to work is part of the only Layer. I had to use a separate layer for this because the text entry boxes cannot be 'state hidden'.

Maria Costa-Stienstra

Hi, Kory.

Thank you for sharing the .story file and the screen recording!

In Storyline, 0 is different than blank in the numeric entry. Since your fields are blank and your trigger is looking for "equal to 0", your project is not working as expected. 

One possible solution is to add a trigger to Set ValueEntry to 0 when the timeline starts on the layer and another one that does the same for the WeightEntry.

Windows 10 (1) 2021-08-19 at 4.48.18 PM

Let me know if this works!