Skip to main content
Nintex Community Menu Bar

Form validation rule not working properly

  • March 13, 2019
  • 7 replies
  • 78 views

Forum|alt.badge.img+1

Hi everyone.

I am working to create a validation rule to require an answer of "N/A" on a dropdown list when the Signed Out dropdown is not "Yes".

The rule I wrte works, however it also trys to force an answer of "N/A" when the Signed Out choice is equal to "Yes".

 

The rule is: {ItemProperty: Signed_x0020_Out}!="Yes"&&{Self}!="N/A"

 

The following variations do not work at all:

not({ItemProperty: Signed_x0020_Out},"Yes")&&{Self}!="N/A"

and

and(not({ItemProperty: Signed_x0020_Out},"Yes"),{Self}!="N/A")

and

and(not({ItemProperty: Signed_x0020_Out},"Yes"),not({Self},"N/A"))

7 replies

Forum|alt.badge.img+7
  • Novice
  • March 14, 2019

From what you described (must select "N/A" if Signed Out), then the logic you want is:

{ItemProperty: Signed_x0020_Out} == "Yes" && {Self} != "N/A"

That is, you should be checking for "Signed Out" equals "Yes" instead of not equals.


Forum|alt.badge.img+14
  • Scholar
  • March 14, 2019

you say you have dropdown conrols - but are they dropdowns for choice control or lookup control?

the two needs to be treated differently.

 

you reference 'Signed out' item property - ie. you take the the value that's already stored in the list item.

so for NEW form form it's always empty (nothing stored yet in the list) for EDIT form it always evaluate to the value valid at the moment you opened the form and do not change throughout the form session.

 

if you want to evaluate/validate current form control value you have to reference 'Named control' variable in formula.


Forum|alt.badge.img+1
  • Author
  • March 14, 2019
Signed Out is a dropdown for a choice control and has 4 choices.
I tried to change Signed Out to use Named control and that has the same effect of making any choice other than N/A invalid regardless of what Signed Out choice is.

Forum|alt.badge.img+1
  • Author
  • March 14, 2019

No, Signed Out has 4 Choices, I want Self to be N/A if Signed out is anything but Yes.


Forum|alt.badge.img+14
  • Scholar
  • March 14, 2019

ok.

then formula

Signed_Out !="Yes" &&  {Self} != "N/A"

should be correct.

 

if it causes validation to fail regardless of Signed_Out value then it means expression Signed_Out!="Yes" always evaluate to true, ie. none of options is exactly "Yes".

make sure you do not have a typo somewhere or there is not a leading/trailing space or any other unprintable character.

you may try to add a calculated value control(s) on the form and let it step by step evaluate (sub)expression from your formula so that you can see how exactly do they evaluate.


Forum|alt.badge.img+1
  • Author
  • March 14, 2019

I used the calculated value control to see what was going on and ended up using the formula: startsWith(Signed Out,"N")&&{ Self }!="N/A".

 

The choices for Singed Out are:

Yes

No - exclude reason1

No - exclude reason2

No - exclude reason3

 

I still can't figure out why !="Yes" did not work. I looked in the control settings for Signed out and there is not a leading or trailing space.

 

Thank you for your help.


Forum|alt.badge.img+17
  • March 15, 2019

@engus13, glad you were able to get this resolved. can you mark which response if any were correct and or reply with what the correct solution/screenshot may be?

 

Thanks for helping others find solutions by posting questions.