Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
i'm trying to set up a shopify flow where the first step is to query products that belong to a particular collection. looking at the documentation here though
https://shopify.dev/docs/api/storefront/2023-04/queries/products
it looks like there's no query argument available for me to query if a product belongs to a collection
then looking on the opposite side where i query collections by title to get their products,
https://shopify.dev/docs/api/storefront/2023-04/queries/collections
it looks likes the products are at a lower level and i'm not sure how to retrieve that. i was thinking of querying collections then try looping through the collection results but "for each" actions don't accept "Get data" actions.
is it possible for me to get those products via shopify flow query syntax only?
thanks
Solved! Go to the solution
This is an accepted solution.
FYI, that's the wrong query documentation. Flow uses the Admin API. https://shopify.dev/docs/api/admin-graphql/2023-04/queries/products
But the point still holds - you can't query products by collections. You could query collections or the same criteria used for a collection. In For each, you can actually loop over those items returned by "Get data", but there is a current limit of looping over a single level (so you can't loop over collections and then products).
What are you hoping to do with this workflow? It may be that there is another solution that will work for you. For example, you may be able to use a trigger and then fetch data rated to that trigger.
This is an accepted solution.
FYI, that's the wrong query documentation. Flow uses the Admin API. https://shopify.dev/docs/api/admin-graphql/2023-04/queries/products
But the point still holds - you can't query products by collections. You could query collections or the same criteria used for a collection. In For each, you can actually loop over those items returned by "Get data", but there is a current limit of looping over a single level (so you can't loop over collections and then products).
What are you hoping to do with this workflow? It may be that there is another solution that will work for you. For example, you may be able to use a trigger and then fetch data rated to that trigger.
I wanted to check if it's possible to do these queries with manual collections but it looks like my original idea with tags and automatic collections is the way to go.
thanks
Hi Paul,
I'm looking for this too so I'll share my use case.
I'd like to use Flow to keep a "New Arrivals" collection up to date. I have set up a flow to get the top 100 products by create date descending and add them to the collection but I need a corresponding workflow to remove the older ones (or clear the collection of all products first).
Open to any way to solve the New Arrivals collection issue, just trying out Flow as it seemed like it might be capable.
Could you instead use a dynamic collection that is based on a product tag? Then you could use flow to set / remove that tag. Tags can also be a query filter.
User | RANK |
---|---|
3 | |
2 | |
2 | |
2 | |
1 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023