Tag_not in a Shopify Flow query. What am I doing wrong?

Topic summary

Goal: Build a Shopify Flow “Get product data” query to email products with inventory_total <= 0 while excluding specific tags.

What went wrong:

  • A comma-separated exclusion list is invalid syntax. When queries fail, Flow returns all products (explains the 100-item email including excluded tags).
  • Correct approach is separate conditions joined with AND, e.g., tag_not:Cookie AND tag_not:Cupcake … AND inventory_total:<=0. Also ensure no whitespace in field names.
  • Reference: Shopify search syntax documentation was provided.

Current status:

  • After switching to multiple tag_not conditions, the result still included excluded tags. No confirmed fix yet for the original Flow query. Suggested next step: simplify to a minimal working query (e.g., tag_not:Cookie AND inventory_total:<=0) and add clauses incrementally.

Related update (resolved):

  • In a GraphQL orders query, tag_not with a multi-word tag returned the opposite result until the tag was quoted: orders(query:“tag_not:‘Special Terms’”). This indicates tags with spaces must be wrapped in single quotes.

Outcome: Partially resolved. Original issue remains open; additional debugging of syntax and incremental testing recommended.

Summarized with AI on December 31. AI used: gpt-5.

Make sure there is no white space in the field.

I need more detail than “did not work” to be able to help. Can you describe what is happening now?

This query for example works in my store:

tag_not:test AND tag_not:lens AND inventory_total:>0