Use Flow to add tags to products from a specific collection (using a schedule trigger)

Solved

Use Flow to add tags to products from a specific collection (using a schedule trigger)

BrunaD
Visitor
2 0 1

Hi there, 

Is it possible to create a workflow to add tags to products from a specific collection at a set day / time? 

We use tags to manage the display of promotional badges on storefront. 

I would like to automate the adding and removal of these badges to run in line with the promotion schedule. 

I tried, but can't seem to find a way to select the correct products under condition when the trigger is set as schedule.

 

Thank you, 

Accepted Solution (1)

paul_n
Shopify Staff
1770 194 413

This is an accepted solution.

Typically for something like this, you would want to do:

Scheduled time

Get product data (filtering by collection)

For each (product)

  Add product tags

 

But you cannot filter by collection_id on the Products query. You could potentially use Get Product Variant Data, which has a filter called collection. But you will likely run into Flow's limit of 100 resources for "Get" action. To get around that, you would have to run the workflow more frequently. You likely would also want to add a "tag_not" filter to your query so you don't pull variants from the same product twice. 

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.

View solution in original post

Replies 2 (2)

TechNinja
Shopify Partner
10 0 2

Hello,

 

You’ll need a custom app to fetch all the products from the specific collection and add or remove tags using the Shopify Admin API. This app can be triggered via a Scheduled Flow workflow that sends a webhook to the app on the desired day/time. Or your app can be configured for scheduled tasks/cronjobs.

 

paul_n
Shopify Staff
1770 194 413

This is an accepted solution.

Typically for something like this, you would want to do:

Scheduled time

Get product data (filtering by collection)

For each (product)

  Add product tags

 

But you cannot filter by collection_id on the Products query. You could potentially use Get Product Variant Data, which has a filter called collection. But you will likely run into Flow's limit of 100 resources for "Get" action. To get around that, you would have to run the workflow more frequently. You likely would also want to add a "tag_not" filter to your query so you don't pull variants from the same product twice. 

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.