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) »
  • How to search for "in group aa" and "not in group bb" using group names
Pages: [1]

Author Topic: How to search for "in group aa" and "not in group bb" using group names  (Read 576 times)

gje21c

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.1
  • CMS version: Drupal
  • MySQL version: unknown
  • PHP version: unknown
How to search for "in group aa" and "not in group bb" using group names
November 09, 2011, 09:44:35 pm
Hi,

I'm trying to do a search in Search Builder to find contacts in Group AA and not in Group BB, but the only option seems to be to use the numeric underlying group id's and the = and != operators. The LIKE operator doesn't test against the group name, and there is no NOT LIKE operator anyway.

Am I missing another page where I can do this ?

Thanks !

Greg E

gje21c

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.1
  • CMS version: Drupal
  • MySQL version: unknown
  • PHP version: unknown
Re: How to search for "in group aa" and "not in group bb" using group names
November 09, 2011, 10:31:46 pm
Ok, RTFM.  I see that this is spelled out in the doco. See attached image. But it's pretty crazy, the average user won't and shouldn't have to know the numeric id of a group.

Plus my knowledge of DB queries says, if you launch a query with SELECT FILE123 WITH GROUP EQ 3 AND .... you could just as easily launch SELECT FILE123 WITH GROUPNAMETABLE[3] MATCHES "Some Group Name" AND ...   Ie. why not just translate the group index to it's name in the query ?

Cheers,

Greg E


xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: How to search for "in group aa" and "not in group bb" using group names
November 10, 2011, 01:26:58 am
Hi,

Search builder isn't meant for the average user.

But you are right, having a "in a not in b" would be a useful search function (with a nicer interface without id).  Would be great if you have the dev power to push it (a custom search).

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

gje21c

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.1
  • CMS version: Drupal
  • MySQL version: unknown
  • PHP version: unknown
Re: How to search for "in group aa" and "not in group bb" using group names
November 10, 2011, 02:12:45 am
Thanks. Hmmm, this is pretty amusing. Every query I post here ends up with "why don't you fix it yourself".  But that's cool .. it's a good product .. support is pretty good .. if I knew any PHP I might have a go. Can I create and save a custom search for my site ? Sounds like I can, I'll have a look.
GE

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: How to search for "in group aa" and "not in group bb" using group names
November 10, 2011, 05:31:13 am
Hi,

Hopefully, some of the answers are "exists already, do xyz" :)

My point was that I agree that's useful... and that one should implement it

custom search is php and you can add them to your site (check out the chapter in the developers book). You can even package them as extensions and that's even easier to install

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: How to search for "in group aa" and "not in group bb" using group names
November 10, 2011, 06:09:15 am

There is already a custom search for this: check

http://drupal.demo.civicrm.org/civicrm/contact/search/custom?csid=4&reset=1

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

gje21c

  • I’m new here
  • *
  • Posts: 12
  • Karma: 1
  • CiviCRM version: 3.4.1
  • CMS version: Drupal
  • MySQL version: unknown
  • PHP version: unknown
Re: How to search for "in group aa" and "not in group bb" using group names
November 10, 2011, 12:14:05 pm
Thanks guys, really appreciate all that.
The support here is actually outstanding.
And there's nothing wrong with saying "half of what you want is here at xyz, and you could extend it at blahblah.php"
(Write 100x "I must not be flippant on the forums")
I will go look at all that on custom searches.
Cheers, GE

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • How to search for "in group aa" and "not in group bb" using group names

This forum was archived on 2017-11-26.