OR() Behaves different

Did anyone notice the OR() is not working properly ? I have an action with simple condition that check the status. Its show 'Y' when I test it. But as per the condition should be it 'N'. ie, [Status] is 'Cancelled' But it still showing the action in the app even if [Status] = "Cancelled". It should be showing only if [status] <> "Cancelled"

It works fine when I use AND() instead of OR(). But how should it work when we use AND() ? Shown in last screenshot it works with AND()

Screenshot 2023-02-25 at 8.07.19 PM.pngScreenshot 2023-02-25 at 8.07.46 PM.pngScreenshot 2023-02-25 at 8.08.07 PM.png

Isn't this a weird behaviour  ?

Screenshot 2023-02-25 at 8.08.38 PM.png

 

Solved Solved
0 13 135
1 ACCEPTED SOLUTION

You are welcome. Yes, the inversion( NOT()) ( <>) with AND() and OR() can be confusing at times. We all go through that situation.

View solution in original post

13 REPLIES 13

Looks like it is Just checking first condition and says its TRUE and not checking second condition in OR(). OR() Should check first condition and if its not true it should be checking second condition. Definitely looks like a BUG to me. 

Maybe I'm not following your logic, but it sounds to me like you actually do want AND instead of OR. If [Status] = "Cancelled", then [Status] <> "Closed" is true.

I dont want to show action if its closed or cancelled

if understanding of your requirement is correct, I believe OR() is working as expected. The OR() turns to TRUE or Y when ANY ONE argument is TRUE.  In the example below you shared,  the [Status] is "Cancelled".  So [Status]<>"Cancelled" is FALSE . But since the [Status] is 'Cancelled",  the other argument  [Status]<>"Closed" is TRUE and as a result the OR() evaluates to TRUE.

OR Logic.png

May we know your end goal?

Is it correct understanding that you would like to show the action when the status is anything else than "Cancelled" and "Closed"? 


@dbaum wrote:

Maybe I'm not following your logic, but it sounds to me like you actually do want AND instead of OR. If [Status] = "Cancelled", then [Status] <> "Closed" is true.


@dbaum is correct. My post necessarily says the same thing. 

 


@Rifad wrote:

I dont want to show action if its closed or cancelled


 

Could you please try NOT( IN([Status], "Closed", "Cancelled'))

 

 


@Suvrutt_Gurjar wrote:

Is it correct understanding that you would like to show the action when the status is anything else than "Cancelled" and "Closed"? 


 

You are right. But it is showing even if condition is not correct also.

Thank you. Please try 

 NOT( IN([Status], "Closed", "Cancelled'))

Thanks. I know this workaround. But in my opinion OR() is not working. For other rows when status is "draft" it says 'Y'. As per condition this is correct.

Screenshot 2023-02-25 at 8.44.05 PM.png

 

I believe OR() is evaluating correct in the latest example also. Since the [Status] is neither "Closed" nor "Cancelled", both the arguments are evaluating to TRUE and the result is TRUE.


@Rifad wrote:

Thanks. I know this workaround. But in my opinion OR() is not working. For other rows when status is "draft" it says 'Y'. As per condition this is correct.

Screenshot 2023-02-25 at 8.44.05 PM.png


I believe OR() is evaluating correct in the latest example also. Since the [Status] is neither "Closed" nor "Cancelled", both the arguments are evaluating to TRUE and the result is TRUE.

 

Got it. Maybe I might be confused with the conditions. I will use the other workaround you mentioned.

You are welcome. Yes, the inversion( NOT()) ( <>) with AND() and OR() can be confusing at times. We all go through that situation.

Just as an alternative,  since we were discussing OR() based expressions, we could achieve the same result  with the following expression also. 

NOT( OR( [Status]="Cancelled", [Status]="Closed"))

Top Labels in this Space