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) »
  • Smart Groups not appearing in the member's Groups List
Pages: [1] 2

Author Topic: Smart Groups not appearing in the member's Groups List  (Read 3514 times)

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Smart Groups not appearing in the member's Groups List
January 27, 2008, 01:31:18 pm
I have created a smart group of members whose email is flagged "On Hold". If I look at an individual record then view the groups listed behind the groups tab, I do not see membership in the smart group I have created. (v1.9)

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Smart Groups not appearing in the member's Groups List
January 27, 2008, 06:25:59 pm
This is how things work currently - only static group membership are displayed in the Groups tabs. We hope to figure out a way to do some caching of smart groups in a 2.x release - which will make it "less expensive" from a performance point of view to include them there (as well as use them more efficiently for permissioning etc.).
Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Smart Groups not appearing in the member's Groups List
March 27, 2010, 08:15:10 pm
It's worth noting that if you manually add a Contact to a Smart Group (by clicking Add to Group from the Contact's record) then the contact WILL show up in the list of Groups under the Contact's Group tab.

However, if the Contact is in a Smart Group simply by virtue of meeting the search criteria of the Smart Group, then the Smart group will (as you say) not appear in the Groups tab.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

aeszq

  • I post occasionally
  • **
  • Posts: 53
  • Karma: 0
Re: Smart Groups not appearing in the member's Groups List
April 26, 2010, 05:33:59 pm
Hi guys,

I am trying to make smart groups appearing on the groups tabs. The approach I'll probably go for is writing a mysql procedure to update the civicrm_group_contact table and run the procedure as a cron job.

But before doing that, i'm just wondering whether anybody has done that or something similar. Also, if new version of CIVICRM will include this (as Dave has mentioned above), then I'll probably just wait for the new version.

Cheers,
George.

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: Smart Groups not appearing in the member's Groups List
April 26, 2010, 10:30:19 pm

3.2 will not include this feature. if important to you consider contributing a patch to make this happen. Do ensure that you take performance into consideration when there are hundreds of smart groups (i.e. we cant evaluate 100+ complex queries on that page)

there is a smart group cache (civicrm_group_contact_cache) that will give you this information. however its a cache, and potentially can be stale

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

aeszq

  • I post occasionally
  • **
  • Posts: 53
  • Karma: 0
Re: Smart Groups not appearing in the member's Groups List
April 27, 2010, 04:55:38 pm
Thanks, Lobo. I don't have that many smart groups, lol

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Smart Groups not appearing in the member's Groups List
July 14, 2010, 03:55:04 am
We are in the process of upgrading to 3.x now and our "country administrators" have been thinking that the smart groups problem will be fixed. Unfortunately, preliminary testing (with 3.14) shows that the problem is still there. Once a smart group is created, it doesn't appear in lists of groups available for searching to the person who created the smart group and it does not show in lists of groups contacts belong to.

Since this is probably not going to be fixed for some time, is there any way to disable the function all together so that we don't have to keep disappointing people?


Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Smart Groups not appearing in the member's Groups List
July 14, 2010, 11:10:25 am
I just tested part one of your issue below  in 3.2 -
Quote from: Ozyank on July 14, 2010, 03:55:04 am
Once a smart group is created, it doesn't appear in lists of groups available for searching to the person who created the smart group...

... and it seems to be working as expected. My steps (as a user w/ limited CiviCRM permissions - not an Admin):

Advanced Search - Find contacts where Address State/Prov = California
Created a New Smart Group - "CA Contacts" from search results
Navigate to Manage Groups - my new group is listed and I can see the members
Navigate to Find Contacts - my new group is in the Groups drop-down and search returns the expected members
Add contact w/ CA address and repeat search on Group from Find Contacts - new contact is included in search results


Protect your investment in CiviCRM by  becoming a Member!

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Smart Groups not appearing in the member's Groups List
July 14, 2010, 01:25:09 pm
Agreed with Dave, Smart Groups work as expected.  However, we may be talking past each other here.

Let me jump in.

Smart Groups don't show up in the Contact Record under the Groups tab.  This is perhaps a failure less of the software itself but in the naming of "Smart Groups" - the very name seems to confuses people, as it confused me at first.  Why should not something called "Smart Group" appear under the "Groups" tab, you ask?  It's a reasonable assumption, but untrue.

Instead...... think of Smart Groups instead as "Saved Searches".  From now on I will refer to Smart Groups as "Saved Searches".

When Search criteria is saved as a Saved Search, the Saved Search remembers your criteria and updates the results automatically when you view the Saved Search.  Loading several Saved Searches on each Contact Record page would be incredibly time consuming, as it would result in loading perhaps dozens of Saved Searches each time you looked at a Contact.

Right, "ok so what's the solution" you ask?

I've found the best solution is to create a cache for your Saved Searches.  This means that periodically (once a week) you look at the members of a Saved Search and assign these members to either 1) a static Group or 2) a Tag.  Then these Groups and Tags WILL show up in the Contact record.  Once a week, clear out the static Group or Tag and repeat the process.  While not "real time" it is better than nothing.

« Last Edit: July 14, 2010, 01:26:42 pm by Stoob »
Try CiviTeacher: the online video tutorial CiviCRM learning library.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Smart Groups not appearing in the member's Groups List
July 14, 2010, 02:49:00 pm
Quote from: Stoob on July 14, 2010, 01:25:09 pm
I've found the best solution is to create a cache for your Saved Searches.  This means that periodically (once a week) you look at the members of a Saved Search and assign these members to either 1) a static Group or 2) a Tag.  Then these Groups and Tags WILL show up in the Contact record.  Once a week, clear out the static Group or Tag and repeat the process.  While not "real time" it is better than nothing.

Cool idea. allows to use smart groups for acl if you can accept the "no so real time". Is the code shared somewhere ?
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Smart Groups not appearing in the member's Groups List
July 14, 2010, 10:32:18 pm
xavier: there is no code.  It's just using existing functionality.

1. Select all members of a smart group x
2. Click "Add to Group": create a new static group called "Cache of smart group x"
3. Next week, remove all contacts from "Cache of smart group x"
4. Repeat steps 1 and 2.

Some people prefer to use Tags in step 2, because Tags show up on the Summary page of a Contact record, and are therefore more convenient to see.  Works the same way.
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Smart Groups not appearing in the member's Groups List
July 21, 2010, 02:10:50 pm
I completely understand why these groups can't appear "live" on a contact summary page, and I share the hope that even simple time-based caching will be added in the future to make this possible (the views cache code should provide a good framework for this).

The place where this behavior really threw me was when creating a view. Using the filter group:id to select members of a smart group produces no results! Since Views is running a SQL query anyway, I was surprised to see that the civi views handler was not willing to invoke the DAO query to serve up the proper results.

I understand this would be slow if done for every contact in the view, but if the views handler were to run its query once and then serve those results to views, that could be pretty quick.

Any thoughts guys?
Try asking your question on the new CiviCRM help site.

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: Smart Groups not appearing in the member's Groups List
July 21, 2010, 07:47:56 pm

i think you can do this, the main issue is no one has taken the next step of implementing the views interface for smart groups. currently most of the views interface exposes table and column definitions to views2. not sure how extensible the api is, and if it can take sql snippets (from and where clauses)

wanna take a crack at it, coleman?

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

Dennis Gray

  • Ask me questions
  • ****
  • Posts: 472
  • Karma: 1
  • CiviCRM version: Various. See post.
  • CMS version: Drupal, Wordpress and Joomla. See post.
  • MySQL version: TBA
  • PHP version: TBA
Re: Smart Groups not appearing in the member's Groups List
July 23, 2010, 02:05:08 pm
I followed the steps Dave described a few comments back still had no success. I created a smart group to identify Individuals whose "voting state" is California and who live in Australia. I do not see the name of this group in the pull-down for searching contacts nor as a group in Manage Groups.

If I log in as the Drupal admin, I can see the group.

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Smart Groups not appearing in the member's Groups List
July 23, 2010, 05:20:21 pm
What permissions does the user have who can't see the new smart group? Also do you have CiviCRM ACL's setup on your site? Ideally we can recreate the behavior you're seeing on the public demo - but you might need to instrument in some debug statements in your site to see what's happening. Grab one of us on IRC if you want some pointers to where in the code to do that.

Protect your investment in CiviCRM by  becoming a Member!

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Smart Groups not appearing in the member's Groups List

This forum was archived on 2017-11-26.