I want to create a collection for newly published products that runs off a tag called “new”. I’ve tried to use Flow to add a tag called “new” to all products that were published less than 90 days ago … and remove that tag from all products published more than 90 days ago.
The Flow to add the tags runs at 2.55pm EST. It sorts products by published date descending and then applies this in the edit query box to the first 100 products:
The second Flow runs at the same time. It also sorts products by published date descending and then applies this in the edit query box to the first 100 products:
Note the > has become a <, otherwise it’s the same. The aim is to remove the “new” tag from any products published more than 90 days ago.
It seems like the 2nd Flow is removing the tag from all products as currently there are no products with the tag applied. But there were yesterday!! Any clues?!
Oh. Whoops. Thanks. So do I just change it to publishedAt, which IS a field under product in that link you shared. Or is this just not going to work …?
No, you can’t query any field, only those listed under “filters”. You might have to get creative with this, like putting the date it was published in a tag and then querying by that tag (unfortunately, querying by metafields is also not possible yet via API).
I’ve written a guide you can follow that includes links to download the flows I created.
You’d be looking at ‘step 3’ in the guide.
I use a run code block to determine if we consider the product a new arrival before tagging it. I do this based on the updateAt being a proxy for now, and compare it to the date the product was createdAt. If it’s less than 30 days old and it’s just being set to active, it’s a new arrival.
Only difference is that I’ve triggered this workflow based on product status updated. But you can still check out my code and adjust accordingly.