Happening now | Office Hours: Customizing Your Theme With Moeed | Ask your questions now!

Check if - 5,000 entries

Check if - 5,000 entries

AW
Shopify Partner
2 0 0
 
Good afternoon
 
I would like to check if a postcode is within a list of 5,000. How can I do that?
 
I do not seem to be able to add 5,000 entries to the Check if... statement?
 
Many thanks
Replies 3 (3)

paul_n
Shopify Staff
1814 199 430

Usually when a list gets huge, I'd recommend using metafields or metaobjects instead. For example, you could create a shop metafield and put all you zips in there, and then you can use that metafield in your Flow workflow.

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.
AW
Shopify Partner
2 0 0

Thank you Paul.

 

Once I've created the shop metafield with the postcode values, how can I use this data in flow?

 

When I try to do Check if, Customer Zip is at least one of ......   it does not seem to let me compare it to a shop metafield value?

 

Many thanks

paul_n
Shopify Staff
1814 199 430

It depends on the type of metafield you add. A zip is stored as a string, so I would use a string or list of strings (with one zip per item in the list). 

 

Once you have that set up, you can add the metafield to flow by going to "shop / metafield (requires arguments)". There, you'll be able to choose that metafield. If you use a list, you'll probably want to add that first in a condition (because you need to loop over the list). Then add the whichever zip as the second part of the condition. 

 

FYI, there's isn't yet a UI to set shop metafields...but there are some free apps that allow it like "metafields guru". 

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.