CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Search builder - using NULL operators
Pages: [1]

Author Topic: Search builder - using NULL operators  (Read 1030 times)

yositsitsu

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 2
  • CiviCRM version: 4.0.4
  • CMS version: joomla 1.6.3
  • MySQL version: 5.5.8-log
  • PHP version: 5.3.5
Search builder - using NULL operators
August 18, 2011, 02:42:57 am
Hi guys! What's up?

I've discovered the wonderful world of the "search Builder" and jumped on it as a a means of achieving long desired ability of finding contacts that have not been tagged, belong to certain groups and are in a certain status, say "new".

At the stage of adding the selector "Individual", "tags" operator "is null", in other words "all non-tagged contacts",

I got an unpleasant error saying "Please clear your value if you want to use NULL operator." - WT*?

Then I did some searching in the forum and... Do we still have a problem searching with NULL operators?

Thanks!
Yosi

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Search builder - using NULL operators
August 18, 2011, 03:19:12 am
Hi,

Check on demo see if it's fixed.

Not sure if it would work anyway with tags (that's not an attribute of contacts, but a separate table). You might go faster by writing a custom search.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

yositsitsu

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 2
  • CiviCRM version: 4.0.4
  • CMS version: joomla 1.6.3
  • MySQL version: 5.5.8-log
  • PHP version: 5.3.5
Re: Search builder - using NULL operators
August 18, 2011, 03:31:15 am
Thanks for the suggestion Xavier - I tried - same here...

"Please correct the following errors in the form fields below:
Please clear your value if you want to use IS NULL operator."

What is the above supposed to mean??? That's exactly what I do! (I think...)

See the attached image please.

P.S> i'm really rusty with SQL selects - hope won't need to get into it. The search builder is a wet dream for me - really hope it wroks :)

yositsitsu

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 2
  • CiviCRM version: 4.0.4
  • CMS version: joomla 1.6.3
  • MySQL version: 5.5.8-log
  • PHP version: 5.3.5
Re: Search builder - using NULL operators
August 25, 2011, 05:20:27 am
The search builder idea is so wonderful - anyone has any experience working with NULL value searches???

The smart groups with such searches would be so helpful to humanity!

Thanks.
Yosi

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Search builder - using NULL operators
August 25, 2011, 02:27:53 pm
I think null values works for "real" attributes. For tags, you will need to modify the code (or hire someone) to handle the specific query I think.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

nicol

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 5
  • CiviCRM version: 4.2, 4.3, 4.4
  • CMS version: Joomla 2.5.x, Joomla 3.x Wordpress 3.x, Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.3 / 5.4
Re: Search builder - using NULL operators
September 12, 2011, 09:01:11 am
A patch was suggested a year ago but it hasn't made it into the core so not sure if it works or has any other issues:

http://forum.civicrm.org/index.php?topic=13469.0

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Search builder - using NULL operators
September 12, 2011, 09:22:29 am
Hi,

The tag is very likely a different issue (again, that's not a field of the contact table but a relationship table between the contacts and the tags).

Just tested, the email is null vs. email is not null and it works.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Search builder - using NULL operators
September 12, 2011, 09:30:14 am

Note that the patch did not hit the issue tracker, and hence most likely did not make it.

For patches to make it into core, we need an issue filed along with the attached patch. Currently we also encourage folks to submit a unit/web test to ensure that the new patch works as advertised

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

nicol

  • I post occasionally
  • **
  • Posts: 95
  • Karma: 5
  • CiviCRM version: 4.2, 4.3, 4.4
  • CMS version: Joomla 2.5.x, Joomla 3.x Wordpress 3.x, Drupal 7.x
  • MySQL version: 5.x
  • PHP version: 5.3 / 5.4
Re: Search builder - using NULL operators
September 12, 2011, 12:12:37 pm
I just started to submit an issue for this but couldn't recreate the bug on the demo site.

When I went back to my the system with the original error (I'd been searching orgs, not tags) couldn't recreate it there either - so it must be something that happens under very specific / rare conditions (which I can't find, sorry!)

bmw

  • I post occasionally
  • **
  • Posts: 103
  • Karma: 4
    • Alcohol Justice - The Industry Watchdog
  • CiviCRM version: 4.5.8
  • CMS version: Joomla! 3.4.0
  • MySQL version: 5.5.42-cli
  • PHP version: 5.3.27
Re: Search builder - using NULL operators
September 22, 2011, 04:23:08 am
On other known values like Groups, (IS NOT)NULL does not work either. I need to find all Individuals whom are not in any Group and put them into one before I can do my next import.

[SOLVED] The only way I think I can do this is to put everyone in the Group in question, then do a Search Builder query for 'Individuals' in 'Groups' is '<' '(New Group ID being the highest number)'. Then manually removing each one of the results from the New Group. Then selecting all the results and choosing from the Actions drop-down to 'Remove Contacts from Groups'.
« Last Edit: September 22, 2011, 04:29:15 am by bmw »
Bruce Wolfe, M.S.W., CIO
Alcohol Justice, 501(c)3

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Search builder - using NULL operators

This forum was archived on 2017-11-26.