Can someone explain how this worked?

So this is a piece of my validation on a multi-page form to make sure something is selected before the user can move to the next step. I did this as a shot in the dark because the logic, as I understood it, wouldn’t have worked.

The image is attached. (all these fields have “copy” at the end so I can differentiate the form in progress field vs the completed form field.

I understood this as:
If Model Copy value is a value that is included in the list of “66PRO”, “86 PRO”
and
Hood type copy value is not “VHR”
and
hood type ii copy doesn’t include value “Standard Prewash”
and
Hood type ii copy doesn’t include value “Front Feed PW”
then do this

My question lies with the last two conditions and I understand this as an AND so this shouldn’t have worked. Is the solution that I chose “doesn’t include” vs “is not” that made this work? Say you selected one or the other between “Standard Prewash” and “Front Feed PW”, I expected this condition to fail as it couldn’t be both and go to else.

Are you positive that your copy fields each contain a value? If they were all blank, I could possibly see it passing the validation. What happens if you add a fifth condition that checks if Hood Type II copy is not empty?

2 Likes

When you say “something” is selected, do you mean “anything” as in an input field is not empty, or does it need to be something specific?

Just looking at your screen shot, I find it quite easy to see how all of those conditions would pass. You didn’t provide a screen shot of your data, so I’ll invent some.

Imagine a data row with the following values:

  • Model copy: 66 PRO
  • Hood Type copy: Elton John
  • Hood Type II copy: Michael Jackson

Now let’s validate that row:

  • Model copy is included in 66 PRO, 86 PRO :white_check_mark:
  • AND Hood Type copy is not VHR :white_check_mark:
  • AND Hood Type II copy doesn’t include Standard Prewash :white_check_mark:
  • AND Hood Type II copy doesn’t include Front Feed PW :white_check_mark:

So our imaginary row of data will pass your validation check.

2 Likes

Ahh sorry all, there are some key points of information that is missing from my original post. Below is a recording of the page where different variations of the questions would come up based on what is selected. The part that includes the Standard Prewash and the Front Feed PW is either one or the other and you can’t have both. That’s where it confused me because if you select Standard Prewash, then you can’t select Front Feed PW, and therefore would not pass unless there is some misunderstanding on my part.

Are you positive that your copy fields each contain a value? If they were all blank, I could possibly see it passing the validation. What happens if you add a fifth condition that checks if Hood Type II copy is not empty?

Hi Jeff, yes, I have a validation in the beginning that makes sure that any of these fields, if empty, hits validation point 1 which is a notification that answers need to be chosen. I placed a number in each notification to see which condition occurred and every condition is separate and not overlapping. I found out this ended up working as the notification for a fail if this condition is true came up where a Prewash/PW must be selected.

Every page has a goal of getting to the else function which is a success, go to the next page. They just have to pass stops along the way.


Microsoft​ Edge - · Glide - Work - Microsoft​ Edge - 29 June 2023 - Watch Video

As you’re using a custom form, I think the best advice that I could give would be to move as much of your validation logic as possible to the Data Editor. If you do this, you should find things much easier to manage and maintain.

The general idea is that you create one or more if-then-else columns that will return true when conditions are met (or not), and then that ProStep2 action that you show above could probably be simplified to something like “If canMoveToNextStep is checked, then Increment”

If we go back to your earlier example, the way you would convert that to a single boolean would be as follows:

  • If Model copy is not included in “66 PRO, 86 PRO”, then null/false
  • If Hood Type copy is VHR, then null/false
  • If Hood Type copy II includes Standard Prewash, then null/false
  • If Hood Type copy II includes Front Feed PW, then null/false
  • Else true

Essentially, you just reverse the comparison checks you’d do in the Action Editor, eliminating all the failing conditions one by one, and anything that falls through to the “Else” will have passed validation.

(yes, I realise the above may not be an exact representation of what you are trying to do, I am just using it as an example)

2 Likes

I’ve read this a few times and I’m struggling to understand what your issue is. Should it be falling into that IF condition to issue the error, or should it be moving on to the ELSE?

What’s your definition of “pass” in this case? Pass, as in “fell into the IF condition to issue the error message”? Or Pass, as in “failed the condition and moved on to the ELSE”?

1 Like

While I’m sure the experts will get your validation sorted there’s room to improve the form itself.

If it was me I’d replace the choice component for “base model configuration” with a button block. Based on which model is selected I would clear the choices of “secondary” and “scraps” with a set columns action from the button block.

This will render it impossible for the user to mismatch that specific selection.

This method will cost you a few more updates but it’s something to think about.

2 Likes

This works, I just don’t understand how it is working is the only issue. My main concern is the last two conditions of the validation for the secondary machine configuration.

For example:
Ignoring everything else as it passes the condition.
For Hood Type II doesn’t include Standard Prewash
For Hood Type II doesn’t include Front Feed PW

The actual form itself has visibility logic to only allow you to select Standard Prewash or Front Feed PW (with the addition of some other choices that don’t matter). So you cannot select both Standard Prewash AND Front Feed PW.

If someone were to select Standard Prewash and say… High Hood. I understand that condition should have PASSED and will always PASS (because it doesn’t unclude the other “Front Feed PW”) and display a notification configured under it and never go to ELSE which moves to the next step.

I thought that there is an implied AND between the two Hood Type II copy conditions but it’s acting like an OR (which is great!)

I think I need some time to read everyone’s responses and understand it. Thank you for taking the time to reply, everyone.

So as I understand it, it’s currently moving on to the Else, which is what you want, correct? I think I understand the question. Just trying to run the scenario through my head, and understand what you are expecting.

In your video, you selected Front Feed PW. Since you selected that, the IF condition fails because it DOES in fact include Front Feed PW. Since the condition fails, it does move along to the Else. The only time it would not fail the condition and fall into that branch, would be if you selected neither Standard Prewash nor Front Feed PW.

I think you may be focusing on what happens if you select both instead of what happens when you select neither.

3 Likes

AWWWW man your explanation just made me get it.

Re-explaining what you’ve just said to lock it in for me.

The point of this validation is to make sure that the user does select either Standard Prewash or Front Feed PW in addition to or not with the Prison Package or High Hood option (if available).
I already have a condition that checks for empty fields so one could get this question wrong by selecting the other selections (Prison Package or High Hood) but the question is still wrong because they need to select Standard Prewash OR Front Feed PW. So if they select High Hood, the field is no longer empty and then goes to ELSE, but I needed them to select choose a Standard Prewash or Front Feed PW.

If neither is selected this condition works because it doesn’t include Standard Prewash AND Front Feed PW and the notification runs alerting them to select one or the other.

But once one is selected, the condition fails and it goes to ELSE because someone DID select Standard Prewash OR Front Feed PW.

It is so clear now thank you as this validation doesn’t go to ELSE (which is desired to continue to go to next step) in the ONE condition where BOTH (and) does not have Standard Prewash or Front Feed PW).

I need more sleep… Thank you Jeff and everyone!

Darren and Eric I will keep your suggestions in mind as they both will help me prevent getting confused by layers of conditions/validations. Eric I have used the button block in a few things, and it definitely cleans up whatever process im doing here and makes it easier to keep track of. Also in combination to your suggestions, I can just do some if then in the Data Editor in addition to simplify the front end more.

3 Likes

Glad to help! Glide’s approach to IF logic is not great in my opinion, because we have to really twist our minds with these ‘Not’ conditions when it would be a whole lot simpler to mix AND and OR logic with some simple parenthesis, like you would with code. I’ve done some glide IF logic in the past that made me pull my hair out…all while knowing how much simpler it would have been to write it in code. So I totally understand how it can get confusing to follow. We’ve all been there.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.