Upvote 1

Having variable display default when field left empty?

In Progress Zach Prichard 5 years ago

Hey folks!

I feel like I have the solution to this on the tip of my brain but can't quite get there.

I have a form where you can enter data into 10 text fields. Each text field has a variable assigned to it. Each variable also has a default entry.

When you hit submit it goes to the next page where the captured data is shown in 10 individual labels.

Now, this functions fine! If you enter data into all 10 fields of course. If you leave a field blank, well it displays blank on the next page. Essentially the variable is capturing the empty text field as the actual value.

What I would like to happen is a basic function that says "if text field left empty then assign default value to variable"... and then for all other fields that receive a typed in value to properly capture it as it's currently doing.

Does that make sense?

I'm almost there with the expression builder but can't quite get it.

Replies (1)

You'll need to create conditions that detect when the variable's value is left blank. On the next page, create an "On Page Load" + "Set Value" event for each text field that displays the value of a variable. Create a condition for this event that is When... variable ≠ [blank] (leave the space blank). This will make sure that the text is given the variable's value only when the variable is NOT blank.

Click the 'Else' text and create "On Page Load" + "Set Value" event. For the value, type in whatever you'd like to display when the value has been left blank. We've typed 'This value left blank'.

Check out the attached prototype for an example, and let me know if you have any questions.

Leave a Comment
Attach a file