Table of Contents

Google Doc

Recommendations on using Smart Groups

Group Types

There are three ways to create groups.

  • Static Groups: contacts are explicitly added to the group, either singly or in bulk.
  • Saved Search (Smart Group): perform a search and choose Create Smart Group as the action for the result.
  • Custom Search (Smart Group): Almost identical to saved searches, but created by starting with the Custom Search. Primary use is for Include/Exclude searches that can exclude a pre-defined smart group.

The problem with Groups

Smart Groups are one of the most powerful features of CiviCRM. However, there are frailties in the system.

Regular groups are just a list of contacts in the databases. Smart Groups were later added, and perhaps for performance reasons, or perhaps to serve as replacements for regular groups, Smart Groups were implemented also as lists in the database. This is known as the “Group Cache”.

Rebuilding Caches

Because membership in the Smart Group can change based on any records associated with a contact, the Group Cache needs to be updated regularly. This means that the more groups that need to be updated, the longer the time will be that a group goes between updates. Keeping the number of smart groups in the system low, will allow for updating groups frequently.

Groups that Use Groups

Another weakness in the smart group architecture is that there are no protections against deleting a group that is part of the definition of another group. This again, is an argument for keeping the total number groups in the system small, and not using a smart group in the definition of another when the properties desired to filter on can be declared explicitly.

Creating a smart group that filters on another group increases the complexity of the smart group definition and increases the chance of encountering bugs. The smart group system is a pretty amazing feat. Don’t push your luck. Parent-of and Include/Exclude smart groups are the only type of definitions identified so far that require another smart group in the definition, and that is still not always true. Think twice before specifying a smart group in your smart group filter. A regular group is fine to use.

“Child” Groups

Not groups of children, but groups organized as a sub-set of another “Parent Group”.

Child groups should be removed and avoided to maintain performance of the system.

CiviCRM has a flawed implementation for rebuilding groups when a group is marked as a child of another group.

Child/Parent relationships are managed on the child group. Go to the group settings and remove the parent group.

img

img

….

img

Work-Arounds to Known Problems

Creating Parent-of Groups

The recommended technique for creating groups of parents of children, is also a work-around that causes the group to appear empty. See the section on “Parents of” Groups for the description of the work-around technique, which is also generally a good technique and not just a work-around.

When creating a Parent-of Group, there is a bug that presents under the following circumstance:

  • Specifying a Relationship Type
  • Specifying a Target Group for the relationship that is a Smart Group.

Creating Exports

Known Issue: Exporting a Parent-of group contains the children and not the parents. This is caused by having a search defined that uses the “Display Results as: Related Contacts”.

Work-around: You will have to use the default “Display Results as: Contacts” and instead, use a Relationship filter and target group. NOTE: this also has known issues. If you get no results for your search when you are sure that you should, you will have to reset the form and re-enter your filters.

Indicate Purpose In Group Names

Agree on a convention for naming groups that indicates the degree of care needed before deleting or updating. And then follow up to ensure that Chapter Leaders are using the conventions.

  • “Pre-Filter” - for groups that will be specified by other groups
  • “Temp” - for groups that can be deleted after some date.

For example:

  • “Have Registered - Pre-Filter”, indicating that other groups are expected to build on this group and so it should only be removed or altered with care.
  • “Deposit Not Paid 2018-19 - Temp”, to indicate that in 2019-20, this group will be irrelevant.

When not to use a Smart Group

A smart group is good when you want contacts to automatically be added to a group.

A good example of when you might use a smart group, but really shouldn’t, is when you want to base a mailing off of a criteria that is not going to change before you send the mailing. Instead, perform your search, and use the search action to create a new mailing.

“Parents of” Groups

To create a group of the Parents of children, use the “Display Results As” option in the advanced search and select “Related Contacts”. The Group to filter on is then the children and no group filter should be used in the “Relationship” options of the group search.

img

img

Include/Exclude Custom Search

This is probably the only way to identify contacts that DO NOT have a certain characteristic.

  • Create a smart group that represents the contacts THAT HAVE the characteristic, e.g. have paid.
  • Identify or create the group of contacts that may or may not have the characteristic, e.g. All Parents.
  • Use the Custom Search to include all of the potential contacts you are interested in and exclude those that already have the characteristic.

Search > Custom Searches

img

img

img

Identifying “Not-Paid” Contacts

I see a lot of groups getting created to target contacts that have not paid a fee. Perhaps this does not need to be a smart group if scheduling mailings is not the primary motivation. The benefit of the smart groups is you could schedule a reminder email to be sent at the end of the week. You know that some contacts will pay in between scheduling the mailing, and when it is sent. If however, you don’t expect a significant change in the list of contacts before the mailing goes out, then the group can be treated as static. It could work like this:

  • Create a tag: “2018 Deposit Needed”
  • Search for all parents in the Chapter and add the tag to the contacts.
  • After some time and some payments are received: Search for the participants in the event, Use the “Remove Tag” Search Action to remove the tag from contacts that have paid.
  • Send a mailing based on the “Deposit Needed” tag.

img