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

How to create an internal email listing products with today's inventory timestamp?

How to create an internal email listing products with today's inventory timestamp?

dgrow
Shopify Partner
5 0 1

Goal:

Send an internal email that lists all products or variants where the metafield "inventory timestamp" contains today's date.   Screen Shot 2022-08-25 at 4.49.34 PM.png

 

Name: inventory timestamp

Namespace and key: custom.inventory_timestamp

 

 

Could anyone help with the snippet that would go in the "Message" section when building the email step in Flow?

Screen Shot 2022-08-25 at 4.55.49 PM.png

 

I'd also love creative suggestions for trigger.  For now I'm trying to use the app "Timed Actions" but I have no idea whether it will work.  (why can't time/date be a Flow trigger???)

 

Thanks!

Replies 5 (5)

paul_n
Shopify Staff
1431 157 332

Flow has a Scheduled time trigger in Beta right now. Like this trigger you are using, what you'll realize is that without an event trigger there is no data to use in the workflow, so you need a way to get the the data. As part of the beta, we are adding a way to query products, for example. The main issue for this use case is that metafields can't be used in queries yet, so the beta won't work for you (especially if you have to go through all products). 

 

An alternative way to solve this would be for you to use the Product added to store trigger. And then build your workflow to look for the metafield and do whatever. They go into the admin, select up to 50 products at a time, and click "More Actions > Run Flow Automation" and choose that 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.
dgrow
Shopify Partner
5 0 1

thx Paul, that's great to know.

 

so am I correct in assuming that there is no way to say :

 

search for and list all products containing today's date in the inventory_timestamp metafield

 

in html or liquid code?




paul_n
Shopify Staff
1431 157 332

The HTML or Liquid part isn't the problem. The problem is that you need a way to get all products with that metafield, which right now would require getting all products in your store every time. If you have more than a hundred or so products, that won't be viable. If the products had some other field that you could filter on, it might be possible.

 

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.
dgrow
Shopify Partner
5 0 1
I see.  What if I set up a FLOW that tags all the relevant products
throughout the day?  Then I could add a criteria like "if product
carries tagX"...

Would that work?


paul_n
Shopify Staff
1431 157 332

Yeah, you can query by tags

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.