Creating and updating a smart group
Searching for contacts and doing something with the set of results is a day-to-day task in CiviCRM. For example, you might want to find all your contacts that live in Alaska and send them a mail shot. This is pretty easy to do in Advanced Search, and you can add all the contacts you find into a group called Alaska. This means that you can always go back to the group and find the contacts you added. The group represents a snapshot of your data that you took when you did the search and added contacts to the group.
The problem is that if new contacts are added into CiviCRM who live in Alaska, you will have to remember to add them to the group, and you will have to remove them from the group if they move from Alaska.
To overcome this problem, CiviCRM has smart groups. Smart groups automatically contain any contacts that match your search criteria. So, if the data in your contacts changes, or contacts are added or removed, this is reflected dynamically in the smart group without you having to do anything.
How to do it…
Creating a smart group is easy. We just perform a search and create the smart group directly from the search results screen:
- Navigate to Search | Advanced Search.
- In this example we are looking inside an existing group called Newsletter Subscribers for contacts tagged with "shape career".
- From the search results, use the actions drop-down menu and add these contacts to a new smart group and call it Newsletter Shapers.
- You can access the smart group by navigating to Contacts | Manage Groups.
- Now let's suppose we want to change the criteria. Locate the smart group you created and click on the Contacts link. This will list the contacts in the smart group.
- Click on the Edit Search Criteria button at the top of the group screen. This will display the Advanced Search pane with the existing criteria loaded.
- Amend the search criteria to get a different result set.
Here we added an extra tag to our search criteria. Now click on Search to see the new set of results.
- If the search results are what you want, you must use the actions drop-down menu to update the smart group as shown in the following screenshot:
How it works…
Smart groups are based on search criteria. They are effectively saved searches. So if you find yourself repeatedly doing the same search, save the results as a smart group to save yourself time.
See also
- Find more about CiviCRM groups and tags at http://book.civicrm.org/user/current/organising-your-data/groups-and-tags/