How to Use Shopify Flow and Metafields for Product Expiration Alerts?

How to Use Shopify Flow and Metafields for Product Expiration Alerts?

Sanjeevi
Shopify Partner
1 0 0

Hi,

Can I set up a workflow in Shopify Flow using metafields to send email alerts before a product's expiration date? I want the workflow to fetch product data, check if a specified metafield date (e.g., expiration or notification date) matches a pre-defined date (e.g., 10 days before the expiration date), and send an email alert. I have over 6000 products—can this workflow efficiently handle such a large dataset?

Reply 1 (1)

paul_n
Shopify Staff
1491 161 349

A recent API change made querying products by metafield value possible, but you cannot yet query by dates. https://shopify.dev/docs/apps/build/custom-data/metafields/query-by-metafield-value

 

If the field was a string you might be able to use a scheduled time trigger + Get product data to find products that expire today. 
You could convert the date metafield into a single line text metafield and then do this approach. 

 

If it's a date, you would have to periodically scan all 6000 but there is no straight-forward way to do that on a daily basis. 

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.