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 building - Groups
Pages: [1]

Author Topic: Search building - Groups  (Read 2945 times)

CousiMo

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 2
Search building - Groups
May 28, 2008, 10:05:52 pm
When doing a search builder, Individual, Group(s), !=, 12 (group 12 =  interview performed)

i get the following results for the query:

    *  Member of Group != Exit Interview   ... AND ...
    * Group Status - "Added"   ... AND ...
    * Contact Type - 'Individual'
 
the problem with this, is if there's no group "added" at all to the participant than it wont show up in this query,

1. is there a way to change and take out group Status - "added"

2. Suggestion would be to allow users to see the sql code that's running in the search builder and allow editing to it .. do the search and then update the smart group profile.


Thanks for your reply

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 building - Groups
May 29, 2008, 01:15:45 am

1. I dont think there is a way to change this in 2.0 (or 2.1 for that matter)

2. your suggestion is pretty much custom search. You can see the query in the mysql query log and then use the query in your custom search page

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

CousiMo

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 2
Re: Search building - Groups
May 29, 2008, 10:48:16 am
Thanks again for your reply

What we do is we conduct interviews and then we make an Action that we did that. So I want to be able to generate a list of all those contacts who do NOT have such an action. That's what I tried to do above, but it doesn't work. Is there another way I could do this
thanks

Cousi

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Search building - Groups
May 30, 2008, 01:57:49 pm
Might be better to make "Exit Interview" a searchable custom field. Then it would be easy to search / create smart group etc from Advanced Search.
Protect your investment in CiviCRM by  becoming a Member!

CousiMo

  • I post frequently
  • ***
  • Posts: 126
  • Karma: 2
Re: Search building - Groups
June 02, 2008, 06:46:34 am
Dave

I did that.. now i have a group " exit interview" which means everyone that had one.. but i want to creat a group who DID NOT have one..   a smart group.. if they aren't in the "exit interview" gropu or if they didn't have any acivity " exit interview" (which is the same thing ) then it should auto put them into the smart group " did not have an exit interview)

thanks again

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Search building - Groups
June 02, 2008, 07:50:51 am
If your custom field is a Yes / No radio button which defaults to "No" - I think you can create a smart group of contacts with the value of that field is "No". Did you try that?
Protect your investment in CiviCRM by  becoming a Member!

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 building - Groups
June 02, 2008, 12:21:54 pm

This will not work, since it will only give you all the contacts who have custom data, and for whom the value is 'No'. (i.e. if a contact does not have custom data for this custom group it will not appear). You can get around this, by ensuring that every contact has a value for that custom field (potentially using batch update by profile). Writing a custom search might be a better alternative

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

FredJones

  • Guest
Re: Search building - Groups
June 02, 2008, 12:48:21 pm
> Writing a custom search might be a better alternative

Out of curiosity, how does one write a custom search? I mean I know how to write the SQL and in fact I even know how to execute that against the CiviCRM DB in a Drupal module, but I don't know how to get search results to appear in the 'regular' search results page of CiviCRM with all the options.

Perhaps I am missing something obvious?

Thanks!

tonyg

  • Guest
Re: Search building - Groups
June 02, 2008, 01:51:29 pm
Hi Fred. This should get you started http://wiki.civicrm.org/confluence/display/CRMDOC/Custom+Search+Components

FYI, this is for 2.0 only

hope it helps
t

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Search building - Groups
June 02, 2008, 09:11:03 pm
Depending on how short term or permanent a fix you need, can you just make a Group that includes everyone (But call it Not Yet Interviewed) and then remove all those you have interviewed ie Adv Search = Exit interview Group >> more actions = remove from group (select group is your 'Not Yet Interviewed' group?)

Of course this means you either have to repeat this whenever you need an update, or remember to remove the person who has just been interviewed from the Not Yet Interviewed Group at the same time as you add the to the Exit Interview Group
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

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

This forum was archived on 2017-11-26.