ctoper11
Cloud Wanderer

Making a field required based on two values one a Dropdown the other text

Jump to solution

I have a dropdown with a Yes/No Value. If Yes is chosen a panel gets unhidden where there are two single line of text columns. I need the form not to be able to be submitted until those two columns have text in them. For some reason I can't seem to get the rules correct. This is what I have on both columns. Thanks as always for your help

 

not(contains(Column Name, "Yes")) && isNullOrEmpty({Self})

0 Kudos
Reply
4 Replies
ghaiashish
Process Pupil

Re: Making a field required based on two values one a Dropdown the other text

Jump to solution

Hi ctoper11

 

Yes/No feild is a boolean feild try using true/false instead of "Yes"

Please revert if that doesn't work

 

Regards
Ashish

0 Kudos
Reply
ctoper11
Cloud Wanderer

Re: Making a field required based on two values one a Dropdown the other text

Jump to solution
Hi there Ashish, htanks so much for your reply. I apologize I wasn't totally clear with my explanation. It's not a boolean field it is actually a Choice Menu with the words Yes and No in it not the Yes/No checkbox you are referring to.
0 Kudos
Reply
Tarf
Design Canvas Artiste

Re: Making a field required based on two values one a Dropdown the other text

Jump to solution

Hi @ctoper11 

 

Your rule basically says

"When COLUMN is not 'Yes' and the text control is empty, it is invalid".
But you want it to be invalid if "Yes" is chosen and no Text was provided, so this should work:

CHOICE_CONTROL == "Yes" && isNullOrEmpty(TEXT_CONTROL)

Please note that you may also just omit the "not()" part of your formula. I think rules with "==" / "!==" are easier to read.

Apply this rule to "TEXT_CONTROL" (or using {Self} like you did in your example - this works too)

View solution in original post

Reply
ctoper11
Cloud Wanderer

Re: Making a field required based on two values one a Dropdown the other text

Jump to solution
That did it thank you Tarf!
0 Kudos
Reply