I’m trying to figure out if it’s possible to pull data from a collection metafield and add it to an order metafield using Shopify Flow.
So far, I’ve tried creating a Flow triggered by “Order Placed” and using a “Get Collection Data” query, but I haven’t been able to make it work. Is this possible? If so, can anyone point me in the right direction or let me know if I’m wasting my time?
For some additional context (not necessary reading, but helpful if you’re curious)…
Our orders each have different lead times, which we currently manage using Shopify Flows and tagging to indicate the type of lead time that applies (e.g., standard, custom, reduced). However, the actual lead time value (e.g., the number of days or weeks) isn’t stored anywhere right now.
We want to store this lead time value on the collection metafield as the single source of truth. This way, if we need to update lead times, we can change it in one central location, and everything else—like order records and customer communications—will pull from that updated value.
When an order is placed, we’d like to copy the lead time value from the collection metafield to an order metafield, so it reflects the lead time at the time of purchase. If the lead time changes later, new orders will use the updated value, but existing orders will retain the lead time that was copied when they were placed.
For context: I’m not a developer but have some basic knowledge of Shopify Flows and queries.
Any help or insights would be greatly appreciated!
An order can have multiple products that are in multiple collections.
To check collections on an order product, the path would be “Order / LineItems / Product / Collections”
If you follow that path and choose “Metafield (requires arguments)”. That will allow you to pull that metafield for each collection attached. Be careful about pulling too much data here by choosing the wrong path.
Because that will require a list of products and their collections, you’ll likely need to write some code to pick the collection that you care about. I’d recommend using Run code. If you only ever have one collection per product, you could simply pick the first item in the list for each problem. But then you’ll need to compare a product with every other product.
I don’t suppose you are able to recommend someone who could help with this?
I found an official partner dev through the website, and unfortunately they have failed at delivering a working flow. I really need to find someone who knows their stuff!
Thanks so much for your help, this would be a game changer for us!