Hi everyone,
I’d like to create a workflow in Shopify Flow that automatically checks my entire inventory and adds the tag ONSALE to products when their price is lower than the compare-at price.
I’ve already tried following several other posts and guides, but none of them worked for my setup.
I’ve attached a screenshot of my current workflow. In the image, you can see the part where I use Get product data to retrieve products. I tried filtering products with queries like is_price_reduced:true to only get items where the price is lower than the compare-at price, but I’m still not getting the results I expect.
Has anyone built something like this? What’s the best way to set up the flow so it scans all products and applies the tag correctly?
In my experience, is_price_reduced is not very reliable.
IS_PRICE_REDUCED
An attribute evaluated based on the compare_at_price attribute of the product’s variants. With is_set relation, the rule matches products with at least one variant with compare_at_price set. With is_not_set relation, the rule matches matches products with at least one variant with compare_at_price not set.
For example, in my test store, first item returned does not even have “Compare At” price:
i have more than 1000 products, and every one of them has a compare price and a price. is it something i could do directly in the flow without the custom quiery?
Unfortunately, there is no nice solution in Flow (in my opinion).
The IS_PRICE_REDUCED attribute is not reliable, and Flow does not have triggers like “product updated” or “price changed”.
Given that you have more than 100 products, you’d need to implement some extra tagging to loop over all of your products.
After that, create a workflow that starts with the Product variant field changed trigger. Then check whether either the Compare-at price or Price field has changed
This workflow will automatically keep the ONSALE tag up to date whenever product prices change.
You can also run these actions once for all products in the shop without any limitations on the total product number. If that’s relevant, let me know and I’ll describe how to do it.