Variable for if data entry left blank?

Sep 19, 2014

I have a slide where the user is asked to type in their name. It's possible for someone to click the next button without actually putting there name in. The problem is there are slides after where their name is used, and without putting in a name, those field areas are blank.

I want to create a variable where if the text entry is left blank, the storyline jumps to a new slide that says "Don't want to give me your name? That's okay! I'll call you _____" and then that name is used throughout the slides. But I can't figure out how to do this.

Can anyone help?

8 Replies
Douglas Spencer

1. Set the default of your name variable to something like "userName".

2. Put a condition on the next button that would disable it unless "userName" was something else.

By doing this, the user cannot go to the next slide if they do not put in their name.

You could also set up a layer that would be triggered that displays a slide layer with instructions on how to put their name in if the user hadn't entered it yet..

Greg Faust

Hi, Heidi. Welcome to ELearning Heroes.

Yes, what you ask should be doable. Supposing "Jeff" is the default name, it sounds like you want the logic to be:

IF the user clicks "Next" and they HAVE entered a name,

THEN skip the "I'll just call you Jeff" slide and continue with the story.

IF user clicks "Next" without having selected the text entry field and entered a name,

THEN go to "I'll just call you Jeff" slide

Each of those two pieces of logic will be accomplished with a trigger.

The first one will look like:

Action: Jump to Slide

Slide: [the slide after your "I'll just call you Jeff" slide]

When: User clicks

Object: Next Button

[show conditions]

If [TextEntryVariable] != (not equal to) [blank]

The second one will look like:

Action: Jump to Slide

Slide: <insert name of your "I'll just call you Jeff" slide>

When: User clicks

Object: Next Button

[show conditions]

If [TextEntryVariable] == (equal to) [blank]

Then you'll want a trigger on the "I'll just call you Jeff" slide to set that text entry variable to "Jeff":
Action: Set Variable

[TextEntryVariable]

Equal to

Jeff

When Timeline Begins

of [the base layer of the slide]

Does that make sense?

Rebecca Fleisch Cordeiro

Hi Heidi,

If you'd like an instructional video to help you sort it out, I created one a while back.

It shows how to set this up and add a prompt so Learners will know why clicking Next isn't working. On that YouTube page, I also have a link to a thread in this community where you can upload a sample file.

Please shout out with any questions.

Birkman International

I was able to make it so it changed a name field to "My friend" if they left it blank. It was weirdly complex, but I felt pretty cool once I was done. 

This is the gist:

1. I set it to jump to next slide when the timeline ends.

2. I made the timeline pause at 1 second.

3. The name variable changes to to "My friend" when they click Next IF the variable is = equal to (blank).

There's only .25 seconds left on the timeline once they click next!

If further developments have been made in this type of thing since 3 years ago I'm all ears... but this work-around seems to work! :)

Leandra Khoury
Rebecca Fleisch Cordeiro

Hi Heidi,

If you'd like an instructional video to help you sort it out, I created one a while back.

It shows how to set this up and add a prompt so Learners will know why clicking Next isn't working. On that YouTube page, I also have a link to a thread in this community where you can upload a sample file.

Please shout out with any questions.

Hi Rebecca

Thank you so much for the video it helped me to finally achieve this and ended hours of frustration.

Regards

Leandra 

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