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.

Wow.. lol, yup that did it! thank you so much Paul!

1 Like