Can a smart collection be triggered by a tag or meta field?

tcsystems
Shopify Partner
5 0 0

Is it possible to trigger the creation of a smart collection based on a tag or meta field?

Replies 6 (6)

paul_n
Shopify Staff
1009 133 240

You can use the Send HTTP Request action to call the API. 

Here's one endpoint: https://shopify.dev/docs/api/admin-graphql/2024-01/mutations/collectionCreate

 

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.
tcsystems
Shopify Partner
5 0 0
So this is a step in flow that can be created?
paul_n
Shopify Staff
1009 133 240

You choose the action "Send HTTP Request" and use it to call an API. You need to create or choose an API key in order to do that. If you search the community for Send HTTP Request, you'll find some examples

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.
tcsystems
Shopify Partner
5 0 0
This for me is overly complicated. I am not a developer by any means. I
am not sure what to put into the flow fields. I am simply trying to pull
data from a metafield we created, and then look for a collection with that
name and if not one already there create one. I seem to be able to pull
data but not from a specific metafield, and when I do I get this...

header has field value "gid://shopify/Product/9070626373907\n 2022\n\n
Yugioh Joe\n\n The Teen Titans\n\n Yugioh", this cannot include CR/LF

I don't really need to pull the ID of the product I don't think but was
trying to see what it is doing. I simply was trying to pull one field
which is cus_sport_or_game and that should show Yugioh without anything
else.

Please advise if you can.
paul_n
Shopify Staff
1009 133 240

Well you might not be a developer, but you are developing an application to customize your shop when you build an automation. Often what seems simple turns into something a bit more complicated, like for example you need also check if a collection is already there. 

 

Anyway, to check for a collection based on a metafield value, I think you need to use "Get collection data" as an action with pass in a query with whatever is stored in that metafield. Is it the title ?

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.
tcsystems
Shopify Partner
5 0 0

Thanks but I am not to the collection checking step as Shopify doesn't return what I am expecting in some of the previous steps.  I will consider hiring a developer.