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

Order of logic operations on a Run If action?

Jump to solution

I have a run if condition of If [ A AND B OR C]

According to both of these links: 

Logic operators 

Run If

That RunIf should evaluate to false if  is false. However, that's not the case I'm finding. I had a scenario where A was false, but B was true, and the run if evaluated to true and executed. After changing the order of the Run If conditions to be If [B OR C AND A] and the condition (with the same values as before and A still being false and B being true) evaluated to false. Why would this happen? This seems counter to the documentation. What are we missing? We've solved the "issue" by reworking our workflow, but I'm more interested in the "principle" of why this is functioning the way it is. 

Labels: (1)
Reply
8 Replies
mark_greene
Nintex Newbie

Re: Order of logic operations on a Run If action?

Jump to solution

GREAT question Courtney! I have this problem also!

Reply
Automation Master
Automation Master

Re: Order of logic operations on a Run If action?

Jump to solution

I brought up this issue a long time ago on User Voice.   I think being able to use (    ) to surround statements would be helpful.   Vote up the issue here:  More Advanced Conditions in RunIf Action – Customer Feedback for Nintex 

Reply
courtney_shelto
Nintex Newbie

Re: Order of logic operations on a Run If action?

Jump to solution

Thanks, Mike! I gave it 3 votes on User Voice.

Reply
Automation Master
Automation Master

Re: Order of logic operations on a Run If action?

Jump to solution

Hi Courtney Vargo‌,

how C was evaluated in your scenario?

if it was true, than it's right that the first condition was evaluated to true, because Nintex consider the order so first condition is equal to (A and B) or C while second evaluates as (B or C) and A

so, looking at a table with possible results (A is false and B is true like in your description), we have 

(A and B) or C(B or C) and A
A false, B true, C trueTrueFalse
A false, B true, C falseFalseFalse

Giacomo

0 Kudos
Reply
courtney_shelto
Nintex Newbie

Re: Order of logic operations on a Run If action?

Jump to solution

C was false. B and C are evaluating the same field, just checking for different values. So it is something like this:

IF fieldA == value1 AND fieldB == value2 OR fieldB == value3, thus, B and C can not both be true at an evaluation.

Also, for your table with (A and B) or C with parameters A false, B true, C true, I don't believe you're correct that it should evaluate to True. Because your first check of (A and B) should be false because A is false, B is thus irrelevant because for that check to be true, A and B both must be true.

0 Kudos
Reply
Automation Master
Automation Master

Re: Order of logic operations on a Run If action?

Jump to solution

(A and B) is false, as you say, but subsequent evaluation state False OR True (C is True for that row) and it returns True because of C, if it was (A and B) and C, then all of them should be True in order to evaluate true all the condition.

0 Kudos
Reply
courtney_shelto
Nintex Newbie

Re: Order of logic operations on a Run If action?

Jump to solution

Ahh, I was thinking as in our case when C is also false. However, agreeing with the poster above, parentheses would make this easier, because when I created the Run If I was thinking of it as A and (B or C) not (A and B) or C, which changes the logic.

0 Kudos
Reply
Automation Master
Automation Master

Re: Order of logic operations on a Run If action?

Jump to solution

Hi Courtney Vargo‌, if you consider the question as solved, could you mark one answer as correct?

Giacomo

0 Kudos
Reply