How can I tag orders by zip code using Shopify Flow?

DavidETGB
Tourist
5 1 2

My goal is to have Flow look through a list of zip codes that I provide and then to assign a zone order tag if it reads as true that a specific zip code is found.

My problem is that I am pulling a list of around 900 zip codes from a csv file, that I am entering all at once in list format in the zip code field in Flow. Shopify Support recommended I enter each zip code 1 by 1 and hit enter 900 times... Is there a way to tell Flow to look at the full list and go through each zip code entered within that list? Perhaps a built in "or" function somehow? Example list: Zip1, Zip2, Zip3, Zip4, Zip5.

 

08-23-2023(2).JPG

Thank you for any help or recommendations.

Replies 9 (9)

paul_n
Shopify Staff
1056 136 249

Includes will match the string you provide in the zip field, not the other way around. I think you want the operator to be "is at least one of". With that you can provide a list like tags.

 

Alternatively, you could store the zips in a shop metafield and then check is the shop metafield includes the new zip. 

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.
DavidETGB
Tourist
5 1 2

Will "is at least one of" check each zip code in the entire string or will it act like the entire string is just 1 record? I cannot sit here and press enter 900 times to enter each zip code individually (see red pen below); I have a full list that is put in the zip field under 1 entry/record (see blue pen). Is there a function / way to put a separator within my list that will automatically break the zip codes into their own entries?

 

Thank you.

 

08-23-2023(3).JPG

paul_n
Shopify Staff
1056 136 249

We don't auto-split that field on characters because sometimes you want the characters. If you use the shop metafields option then you can just copy and paste them in. 

The flow part:

 

 

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.
DavidETGB
Tourist
5 1 2

Hi Paul,

 

I tried setting it up through metafields and based on today's orders, it hasn't worked yet. In the metafields setup, I entered the zip codes as a list, but it seems like maybe I have to enter each one individually (highlighted yellow below)? Here is what I have so far:

 

08-24-2023(1).JPG08-24-2023(2).JPG

 

Thank you for any help.

paul_n
Shopify Staff
1056 136 249

Those are validations. You need to set the "values". It's not in the Shopify UI yet...so you need to use an app like Metafields Guru to set them. 

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.
uttamk
Visitor
1 0 0

Did this thread get resolved? I am in desperate need of the ability to add a list of zip codes and apply a tag given theres a match with at least 1.

paul_n
Shopify Staff
1056 136 249

You can already do that in Flow. After you choose the zip code field in a condition, choose "Is at least one of". Then enter the zips like tags. Using metafields allows you to do that outside of Flow, but it's harder to set up.

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.
DavidETGB
Tourist
5 1 2

Hi @uttamk if you have a long list to enter like I did, you have to use excel to do some quick formatting first, your output should look like this with your zips in quotes and the entire list in brackets, exactly as below:
["99997", "99998", "99999"]

Then copy and paste that into shopify flow, under the zip code field. You have to start with the "equals" or "includes" option first, paste the list (with brackets) and then change the option to "is at least one of". I figured this out with a lot of trial and error, it's not intuitive at all.

Let me know if you need more detail.

paul_n
Shopify Staff
1056 136 249

That's quite a find! Flow has some conversion logic in there apparently.

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.