Solved

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

  • 30 April 2021
  • 4 replies
  • 24 views

Badge +8

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})

icon

Best answer by Tarf 3 May 2021, 13:38

View original

4 replies

Userlevel 2

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

Badge +8
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.
Badge +8

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)

Badge +8
That did it thank you Tarf!

Reply