Exclude users who already have any of these interests from an audience
Hello! My goal: we are promoting a beginners guide, and I would like to exclude anyone who is already interested in our advanced topics, since the guide would feel too basic for them.
I built it like this and it seems to work:
user's interests is not "automation" and user's interests is not "api" and user's interests is not "webhooks"But three "is not" clauses for one idea feels clumsy, and I will need to add more topics later. Is there a cleaner way to write "has none of these interests"? Thank you in advance
1 answer
There is a direct form for exactly this:
user's interests contains none of ["automation", "api", "webhooks"]Adding topics later is just extending the list. The inclusive counterparts are contains either (any of them) and contains all of (every one of them), so the whole family reads the way you would say it. See the contains none test reference for the exact syntax.
One behavior to decide on explicitly: in CQL, undefined values evaluate to false by design. A brand-new visitor with no interests at all has an undefined interests attribute, so the contains none of clause evaluates to false and they will NOT match, which may surprise you since they technically have none of the advanced interests. If beginners with empty profiles should see the guide, combine the exclusion with a clause that admits them deliberately rather than relying on the empty case.
Also useful for future audiences: negation works at the clause level too, for example page is "checkout" and not user has made purchase, so you are not limited to attribute-level operators.