Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Why does this OR condition evaluate to false in Flow?

Solved

Why does this OR condition evaluate to false in Flow?

amzia
Visitor
2 0 1

Hello folks, new here, and pretty new to Shopify.

I am at a loss as to why this condition in flow is evaluating to false?

Should the second condition not be true, making the whole condition true, or am I setting the second condition incorrectly for it to see the tags as empty?

amzia_0-1728703496569.png

 

Tech Support!!!
Accepted Solution (1)

ryan_i
Shopify Staff
24 6 9

This is an accepted solution.

Hi Amzia,

 

This happens when there are no tags on the customer. The list of customer tags is empty and so it is not true that "at least one of customer / tags" meets the conditions specified. Another approach would be to use "None of customer / tags" instead and update the conditions to be "includes", change the "OR" to "AND", and "not empty and exists":

 

ryan_i_1-1729018105958.png

Make sure to update the "then" and "otherwise" branches based on the updated condition.

 

Thanks!

Ryan

- Finding Flow useful? Leave us a review.
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.

View solution in original post

Replies 5 (5)

heddykhalifa
Shopify Partner
236 17 48
Hey Amzia,
 

Heddy from Gameball: Loyalty Program & VIP here!

 

Looking at the screenshot, it seems the "OR" condition might be evaluating to false because of how the conditions are structured. In Shopify Flow, if any one of the conditions isn’t formatted correctly or doesn't match the exact field data you're targeting, the entire "OR" condition could fail. Make sure each condition is independent, checking the exact data field values and formatting. Double-check that the fields you're comparing are valid for the "OR" logic to apply correctly.

Kalen_Jordan
Shopify Partner
779 36 141

At least one of handles the null state in a weird way. Change it to use None of:

https://help.shopify.com/en/manual/shopify-flow/reference/conditions#does-not-include

ryan_i
Shopify Staff
24 6 9

This is an accepted solution.

Hi Amzia,

 

This happens when there are no tags on the customer. The list of customer tags is empty and so it is not true that "at least one of customer / tags" meets the conditions specified. Another approach would be to use "None of customer / tags" instead and update the conditions to be "includes", change the "OR" to "AND", and "not empty and exists":

 

ryan_i_1-1729018105958.png

Make sure to update the "then" and "otherwise" branches based on the updated condition.

 

Thanks!

Ryan

- Finding Flow useful? Leave us a review.
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
paul_n
Shopify Staff
1430 156 332

How I think about this type of condition:

  • If the list is null, the condition operators for each of the fields in the list have nothing to operate on, so they aren't evaluated at all. 
  • Instead the list operator is used (none of, at least one of, or all of). In the case of "at least one of", if it gets a null then it's false. 

So using "None of" is the best approach if you are trying to check that a tag doesn't exist. If the list if empty, it will return true. If the list has your tag, it will return false. Be careful not to use a double-negative.

 


FYI, this is documented here: https://help.shopify.com/en/manual/shopify-flow/reference/conditions#none-example

 

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
amzia
Visitor
2 0 1

Thanks all, good advice.

 

The simplest solution for what I was trying to do seems to be this:

amzia_0-1729090968718.png

It's accomplishing what I want to do. Cheers

 

Tech Support!!!