A user is trying to create a Shopify Flow query that matches products with an exact tag (e.g., “stylen_ace jacket”) without also returning products with similar but longer tags (e.g., “stylen_ace jacket patterned”).
The Problem:
Using tags:"{{tag}}" returns partial matches, not exact matches
The same behavior occurs in Shopify Admin queries using includes logic
Only one “stylen_” tag exists per product in this case
Proposed Solutions:
Code suggestions using Liquid loops with {% if tags == 'stylen_ace' %} for exact matching were offered but don’t address the core query issue
A workaround using tags:"{{the_tag}}" AND tags_not:"{{the_tag}} " (note the space after the second tag) was suggested to limit matches by excluding tags that continue beyond the target phrase
Status: The discussion remains open with no confirmed resolution to force exact tag matching in Flow queries.
Summarized with AI on November 13.
AI used: claude-sonnet-4-5-20250929.
Hi @josu24
What exactly do you want the functionality to work?
Like what you are trying to achieve
Another thing is if there is only one stylen_ace tag then you can simply add the below code
{% for tags in product.tags %}
{% if tags == 'stylen_ace' %}
{% break %}
{% endif %}
{% endfor %}
That query will always return partial matches like that and I don’t think there is a way to force it to be exact. That said, you might be able to use tags_not…something like:
tags:"{{ the_tag }}" AND tags_not:"{{ the_tag }} "
Note the space after the second one. I think that should limit searches that match something else, assuming they are always separated by a space.