cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
jwstl
Nintex Newbie

validation only evaluating part of expression

Jump to solution

I have a custom validation that is only evaluating part of the expression. It's attached to a choice control (dropdown) 

If I chose 

And a value from the second dropdown

The validation will be successful

If I chose 

And a value from the second dropdown, the control will fail the validation regardless if a value is selected or not

Labels: (2)
0 Kudos
Reply
4 Replies
Automation Master
Automation Master

Re: validation only evaluating part of expression

Jump to solution

1. javascript's '&&' operator has higher precedence over '||'.

so, 2nd and 3rd expressions are first ANDed and result then ORed with1st expression in your formula.

I feel you wanted first OR to be evaluated and then result ANDed to 3rd expression.

2. to check for control emptiness use rather isNullOrEmpty() runtime function

0 Kudos
Reply
jwstl
Nintex Newbie

Re: validation only evaluating part of expression

Jump to solution

Hi Marian,

I have tried the following with the same results

And

0 Kudos
Reply
Automation Master
Automation Master

Re: validation only evaluating part of expression

Jump to solution

you have reordered single expressions but you haven't changed evaluation logic at all.

your formula should look like (simplified)

isNullOrEmpty(SSMP) && (MEO == 'Family' || MEO == 'Adult')

note parentheses there to force OR evaluate before AND.

from logic point of view it doesn't matter whether you put && before or after parentheses.

0 Kudos
Reply
jwstl
Nintex Newbie

Re: validation only evaluating part of expression

Jump to solution

this resolved the issue

is there a reference for the order of rules and logic?

0 Kudos
Reply