I have had incidents where customers ordered items for the price of 0.
How can I set a flow to notify us when there are $0 products uploaded by mistake?
I could set a flow for newly created and newly added items, but there’s no trigger that I can set for existing products and when their prices are updated. The incident was about those products.
So I tried to set a flow to check regularly for items with no price using this query, but it doesn’t work.
The query for the red box(2nd step) is below.
updated_at:<=‘{{ scheduledAt | date: “%Y-%m-%d” }}’ AND updated_at:>‘{{ scheduledAt | date: “%Y-%m-%d” | date_minus: “1 week” }}’ AND (price:0 OR price:null) AND status:active AND -title:Mulberry AND -tag:no-price
I think the ‘AND’ condition doesn’t work at all. so it attached the ‘testing-price0’ tag to every items (100 max) no matter what.
How can I modify this query to work for the condition
-
Among products updated last week
-
the price is 0 or empty (I’m not sure if the price is empty, does the flow consider it’s $0 or should I specify like this to cover both cases)
-
product is published
-
title should not include ‘Mulberry’
-
‘no-price’ tag should not be attached
What is the correct syntax for these conditions to be fulfilled?
Also, are there any other ways that I can hide the product and get notified when the product price becomes 0 accidentally?
Thanks!
Hi @yoonlaser Another route to simplifying the query is making an automated collection for some of the conditions and using that with the get-collection-data action as the resource target; this also surfaces such products in the admin.
https://help.shopify.com/en/manual/shopify-flow/reference/actions/get-collection-data
One way to test queries is using search in the products admin ,making the query without variables, and using the smallest parts possible while building up the entire thing:
updated_at:<=‘2024-10-04’ AND updated_at:>'2024-09-27 ’
then
(price:0 OR price:null) AND status:active AND -title:Mulberry AND -tag:no-price
then
updated_at:<=‘2024-10-04’ AND updated_at:>'2024-09-27 ’ AND (price:0 OR price:null) AND status:active AND -title:Mulberry AND -tag:no-price
https://help.shopify.com/en/manual/products/searching-filtering?q=product+saved+search#search-queries-for-products
https://shopify.dev/api/usage/search-syntax#search-query-syntax
Take advantage of saved searches in the product admin to surface these products in more areas of the admin. https://help.shopify.com/en/manual/products/searching-filtering?q=product+saved+search#save-a-product-search-or-filtered-product-list
Advanced/coding users , for testing grapqhl queries see the shopify graphiql app or tools like insomnia.
If you need automations built contact me for services
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Flow should be capable of this but if you need a different approach or advanced behavior see the mechanic app
It has some examples but nothing for this specific use case https://tasks.mechanic.dev/?q=prodcut%20price
What I always do is run that query directly in the graphiql app in order to debug it:
https://shopify-graphiql-app.shopifycloud.com/login
I tried the same query(just modified updated_at to be from yesterday to today without using a variable) on the product search, it returns 0 items, which is correct. I used the same query on the flow to test. The notification email sent me the links to all 100 products checked. Why does the same query work differently on the product search, and the flow?
Query I used on the flow is
updated_at:<=“{{ scheduledAt }}” AND updated_at:>=“{{ scheduledAt | date_minus: “1 day” }}” AND status:active AND -title:Mulberry AND -tag:no-price AND price:0