0

In Search Builder, if I search for contacts with a particular tag then the output returns the contacts with that tag.

If I then invert the search using 'Not In' or 'Not equals' it shows all the contacts who don't have that contact, but only from the overall set of contacts who actually have a tag. In other words, instead of searching the entire database for contacts who do not have that tag, it only searches all the contacts who have tags, and who in addition don't have that tag.

I believe the same applies to Groups.

This is very unintuitive behaviour; one would expect 'not in' or 'not equal' to apply to the entire database since everything else on all search screens does.

In fact, my SQL friends tell me that this is standard behaviour for searches across related tables; you should append an 'Or Null' query to any such searches if you want results returned from the entire database.

However, this would be too much for our non technical admin users to comprehend! Yet they regularly want to find people who don't have one particular tag or aren't in one particular group.

Is there a work around so that 'Not' searches of tags or groups can nevertheless search the entire database?

We're using 4.6.24 and Drupal 7.54. I'm hopeful of a clever work around to this! Thanks for your thoughts.

1 Answer 1

3

Search Builder is more 'raw' and I find end-users are best to avoid it!

Search > Custom Searches > Include / Exclude Search will do what you want.

Once you have the results you could save it as a smart group for future use.

2
  • Aha - great to know! This is a very helpful solution. Thanks!
    – Andyg8
    Commented Apr 13, 2017 at 10:40
  • In 2023 - use SearchKit!
    – Aidan
    Commented Oct 11, 2023 at 12:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.