Search

As important as it is to understand and become familiar with the contact record interface, we also need to be able to quickly find records in the system. We started our exploration of CiviCRM by looking at the quick search field in the navigation bar. Search | Find Contacts extends this to allow filtering by contact type, group, or tag. Beyond this basic search, CiviCRM provides four power tools for searching and additional diverse functionality through the reporting system.

Quick search

Quick search is found in the navigation menu, and is best used when you are looking for a specific contact. The text entered into this field will search e-mail addresses (by default) and the contact name (sorted by name for individuals, household name for households, and organization name for organizations). The search will return results for partial matches as you begin typing. You have the option of configuring the tool to use full wildcard searches or only ending wildcards (Administer | Configure | Global Settings | Search Settings).

Note

Full wildcard searches will look for the entered text in any part of the name or e-mail fields. For example, entering "john" would find both John Smith and Mark Johnson. With wildcard search turned off, a search for "john" would only find Mark Johnson, as the sort name field is constructed as "lastname, firstname" by default. Full wildcard search is very useful in small datasets as it provides greater flexibility. For large databases, you will typically want to turn this off as the result sets will become long and cumbersome.

If the full wildcard option is turned off, you may still initiate a wildcard search using the percent symbol (%). You may even use the wildcard value in the middle of a search term; for example, J%n will yield John as well as Jones. This "%" character matches any number of characters wherever it appears in your search strings.

Basic search

Clicking on Search | Find Contacts brings up a form that allows you to search by name or e-mail and filter the results by contact type, group, and tag. Entering more criteria reduces the number of matches, as the results must match all of the criteria entered. As with the contact quick search, you may use wildcards to extend how the search is conducted.

Advanced Search

Don't let the term "advanced" scare you away—it's a commentary on the powerful capabilities of this tool, not a statement about how much experience with CiviCRM is required. In fact, the power of advanced search lies in both its flexibility and ease of use. To access this tool, navigate to Search | Advanced Search.

Advanced search provides a window into just about every field in your system, grouped by their type. Using the paneled interface you can build search criteria across address fields, contributions, membership, events, custom fields, and any other type of data you are managing.

The only significant limitation of the advanced search tool is that multiple criteria across the fields are always joined by the AND operator. If you are familiar with any form of query building, you will recognize the difference between joining multiple criteria with AND versus with OR. AND joins are exclusive—as you add more criteria, your result list becomes smaller as more records are excluded because the records must meet all of the criteria provided. OR joins are inclusive—adding criteria expands the result list as any record meeting any of the individual criteria will be included.

The only exception to this rule in advanced search is the fields presented as a multi-select option list (including a set of grouped checkboxes). These will be joined with OR within that field. For example, selecting multiple tags will yield results matching any of those tags.

Be aware that a few special fields reverse the normal selection logic. For example, selecting any of the privacy options will exclude records meeting that criterion rather than including them (reflecting the normal use of those fields). If you are looking to retrieve a list of contacts who have a certain privacy setting, check the option titled Include contacts who have these privacy option(s) in order to reverse the default effect.

As always, inline help text (question mark icon) will provide an explanation and example for non-standard or potentially confusing fields.

Advanced Search

Full-text Search

Have you ever had an experience where you interact with a constituent, perhaps at an event, and can only remember a fragmented snippet of the conversation? You only remember their first name; or was that actually their street address?

CiviCRM's Full-text Search scours through contact and related records, delivering a list of results grouped by the record type (contacts, contributions, memberships, and so on). In addition to serving as your partial-memory sleuth, full-text searches can help you find records where the location of the data you're looking for may not be in an obvious location. For example, you might recall recording details about the Smith's family, but are unsure if it was part of an activity, note, or contribution record, or whether it was attached to Mr. Smith, Mrs. Smith, or their combined household record. Searching for the term "family" yields all instances of the text, allowing you to quickly browse through the search summary and find the information you're looking for.

A full-text search is accessed through Search | Full-text Search, and may be conducted across all major record types, or may be limited to a single type.

Note

Drupal users may enable a Block to provide convenient access to full text search. In Drupal, go to Administer | Site building | Blocks, find CiviCRM Full-text Search in the Disabled section, use the icon to its left to drag and drop it in the region you would like the block to appear, and click on the Save blocks button. Like any block, you can configure when it appears by clicking on the Configure link beside the block name. For example, you might want to set Show block for specific roles to a CiviCRM administrator role.

Search Builder

If advanced search doesn't meet your specific querying needs, CiviCRM provides a search builder to construct criteria sets based on logic statements. Most often, this is needed when your search criteria must include several statements joined with the OR operator (you recall from the Advanced Search section that the primary limitation of that tool is the inability to specify a more inclusive (OR) selection).

Querying... logic statements... operators... criteria sets... huh? The search builder is powerful, flexible, and requires some advanced skill to properly construct a search. For most (if not all) of your searching needs, the advanced search and other tools should prove more than sufficient. However, if the other tools do not completely meet your need, you have the search builder available as a powerful tool in your back pocket.

The builder lets you construct multiple sets of criteria. The criteria within each set is joined by AND. The sets are combined together with OR. That allows you to create exclusive (AND) criteria and join it with inclusive (OR) sets of criteria.

The search builder is accessed through Search | Search Builder.

Note

FPAGM plans to do more regional outreach to food suppliers in the outlying areas of Metropolis and suburban areas surrounding the city. The outreach will be focused on soliciting more commitments for food donation support during the difficult winter months, when demand at the food pantries increases significantly.

The Executive Director has identified the following criteria to be used for the initial outreach letters:

  • All food supplier businesses in Metroville
  • Food suppliers in Metropolis with a postal code of 10255 who have donated more than $500 at one point
  • Affiliate members with a postal code of 10254

The resulting configuration in the search builder will look as shown in the following screenshot (the OR and AND text has been added for illustration):

Search Builder

As you can see, our selection consists of three sets of criteria, which are joined together to yield the result. A food supplier or organization meeting any of the three criteria sets (two of which have multiple restrictive criteria) will be included in the results.

There are several things to keep in mind when working with the search builder:

  • Search criteria can be built based on contact (including type and subtype-specific fields), contribution, membership, event participant, pledge, membership, case, activity, and grant fields.
  • The following comparison operators are used for building criteria statements. Operators define the logical rules for the criteria, determining how the value you enter will be processed using the field selected.
    • = means "equal to", and represents an exact match.
    • != means "not equal to".
    • > means "greater than" and should only be used with number value fields, such as a contribution amount.
    • < means "less than", and should only be used with number value fields.
    • >= means "greater than or equal to", and should only be used with number value fields.
    • <= means "less than or equal to", and should only be used with number value fields.
    • IN is used for groups, tags, and other lists of IDs. The value field may have a comma-separated list (with no spaces) of IDs, surrounded by parentheses, for example, (1,3,9). To retrieve the ID values, visit Contacts | Manage Groups/Manage Tags and note the ID column value. When working in a group or tag (such as in edit mode), you may also retrieve the ID from the URL by looking for the ID or GID number.
    • LIKE means "equal to", but unlike the equal sign, you may use wildcards with LIKE to create fuzzy criteria.
    • IS NULL indicates that the field is empty, containing no value.
    • IS NOT NULL indicates that the field is not empty.
  • Several fields require unique formatting:
    • The State and Country fields may accept either the full state/country name (such as United States), or the ID for the option value (1228).
    • Dates should use the following format: YYYYMMDD. Note there are no spaces or symbols, for example, March 16, 2010 = 20100316.
    • Yes/No fields should have values of 1/0, respectively (Yes = 1; No = 0).
    • Multiple choice custom fields should use the value of the option that was specified when the field was created as the search criteria rather than its label. The value, stored in the database, may be different from your label, which is displayed to users on the screen. If necessary, revisit your custom data configuration in order to ensure that you are retrieving the correct value.
    • Some fields, such as Membership Type, require the ID value for the type, and not the type name. If you try to run a search and receive a warning message to enter a valid value, it is likely to have happened because the field requires an option ID number.

Understanding contact versus component searches

All of the search tools we've reviewed so far are contact-based. Regardless of what criteria you choose, the search will return a list of contacts.

What if I need a list of all contributions over $500 made within the last six months? If John Doe has donated more than $500 three times over that period, I would expect to see him listed three times; the fact that he is a regular donor is important information to see in this context. However, searching through the Advanced Search (where I have access to the contribution fields) or the Search Builder (which likewise can use contribution fields) would yield a list of contacts with no duplicate values.

Throughout CiviCRM, there are typically two "lenses", or perspectives, through which you can search and view records—you can search for contacts, or you can search for their related records. We call the "related record" search a component search. These tools can be accessed through the main Search menu (designated in the second block of options) or in the respective main menu item (for example, Find Participants is found under Events).

Understanding contact versus component searches

Considering the preceding example, searching for this criterion under Advanced Search would yield one record per contact. Conducting this search using the Find Contributions form would yield three records, one per contribution.

We will investigate these tools further when we work with some of the components. For now, it is important to understand the difference in how you search and what type of results are being returned.

Custom search

If you still find that you need to conduct a complex search that cannot be accomplished using one of the tools above, review the custom searches found in Search | Custom Searches....

The custom search structure was created as a way for developers to build customized, complex search options and result lists that could not easily be accomplished through the generalized forms. Let's face it—not every possible search option can be squeezed into a single interface without creating complexity and confusion that will render the tool unusable for the average user. Rather than leaving you to work directly in the database, CiviCRM created the custom search structure to provide an interface for developers to meet these specialized needs.

Existing custom search forms are often being improved and new ones are added to the system by the CiviCRM development community. Understand that to actually create a custom search form, one must have development skills (and access to the database and code). However, once built, sufficiently permissioned users may access the forms and run searches. If you build a custom search form, consider contributing it back to the project for inclusion in future releases.

The full list of available custom searches can be accessed by going to Search | Custom Searches.... (Note that the fly-out submenu only displays a few of the search forms by default.) Some of the more useful searches include:

  • Contribution Aggregate: Searches contacts based on their total giving over an amount range and date range. (For example, searches all contacts who have donated between $500 and $1000 in total contributions over the last year.)
  • Include/Exclude Contacts in a Group/Tag: Builds criteria based on whether contacts have (or don't have) certain group memberships or tags selected.
  • Proximity Search: If you have geocoding enabled in your system, you may search an address or postal code, and retrieve a list of contacts within a defined radius. This form can also be filtered by tags. For example, FPAGM wants to search for all non-profit food pantries in a 10-km radius of the postal code, 10255.
  • Activity Search: Searches for activities based on the contact type, activity subject, activity type, status, or dates.
  • Price Set Details for Event Participants: Price sets provide flexible options for configuring event fees. However, their flexibility creates some complexity when generating lists of event participants. This search will return a list of registrants for the selected event, broken down by the price set fields and options.
  • Contributions made in Year X and not Year Y: Charitable not-for-profits who rely heavily on donations for their revenue will want to identify past contributors who have not donated recently. This grid-based search form retrieves contributions for date ranges and amounts you've designated for inclusion (past years) and exclusion (not this year).

The list above is just a partial review of the custom searches available. Take time to familiarize yourself with the tools available as you may want to make use of them as you work in the system.

Tip

By default, CiviCRM only includes a few custom search forms in the Custom Search fly-out menu (main Search menu item). If you find that you are using certain custom searches frequently, consider modifying your navigation menu to include the desired page in the search menu item listing. Visit Administer | Customize | Navigation Menu to configure the navigation menu.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.82.21