Re: Contains defined tag but condition is not true

Solved

Contains defined tag but condition is not true

tchan122
Excursionist
16 0 8

tchan122_0-1712037234883.png

I have a condition that checks if at least one customer tag contains "Inactive" but it didn't trigger. Can someone help on this? Happy to share more details.

Accepted Solutions (2)

DaveMcV
Shopify Staff
104 31 30

This is an accepted solution.

Hi @tchan122,

 

Try checking for whitespace on the string you're testing against or the tag. Often there may be a space which is not shown in the page markup but will be shown in the Flow editor or customer tags list.

 

Hope that helps!

DaveMcV | Flow Development 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.

View solution in original post

DaveMcV
Shopify Staff
104 31 30

This is an accepted solution.

Hi @tchan122,

 

The way that is structured, it is checking the same item as it iterates through it, which is why it shows as both checks matching but the condition evaluating to false. There are each tag in there but it's never true at the same time.

 

If you just want to check for two tags like you mentioned, do two loops through the tags so you have two At least one customer / tags loops, one for each tag.

 

Hope that helps!

DaveMcV | Flow Development 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.

View solution in original post

Replies 5 (5)

DaveMcV
Shopify Staff
104 31 30

This is an accepted solution.

Hi @tchan122,

 

Try checking for whitespace on the string you're testing against or the tag. Often there may be a space which is not shown in the page markup but will be shown in the Flow editor or customer tags list.

 

Hope that helps!

DaveMcV | Flow Development 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.
tchan122
Excursionist
16 0 8

Hi @DaveMcV , thanks for pointing that out. I did have a few empty spaces within the Flow condition string.

tchan122
Excursionist
16 0 8

Hi @DaveMcV , I have a somewhat related question. I have a condition that checks for 2 tags. Both of them is accepted but the overall condition failed when I've set the condition as "At least one of customer / tags". I understood this as if either or both were accepted, the condition would also be accepted.

Could you help me out with this? Thanks

tchan122_0-1712547390299.png

 

DaveMcV
Shopify Staff
104 31 30

This is an accepted solution.

Hi @tchan122,

 

The way that is structured, it is checking the same item as it iterates through it, which is why it shows as both checks matching but the condition evaluating to false. There are each tag in there but it's never true at the same time.

 

If you just want to check for two tags like you mentioned, do two loops through the tags so you have two At least one customer / tags loops, one for each tag.

 

Hope that helps!

DaveMcV | Flow Development 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.
tchan122
Excursionist
16 0 8

Thanks @DaveMcV , it reads like it should work with both ways but thanks for sharing the solution.