Novice

## Order of logic operations on a Run If action?

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

According to both of these links:

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.

8 Replies
Novice

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

GREAT question Courtney! I have this problem also!

Scholar

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

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

Novice

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

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

Contributor

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

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

Novice

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

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.

Contributor

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

(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.

Novice