In Spotler CRM, the criteria builder defines which records appear in a report, list or tag. You build criteria from groups that contain rules. You can combine groups with AND or OR, exclude records with an exclude group or sub group, and add sub groups for more complex selections. You find the criteria builder under Choose Criteria in the Segmentation step of a new report, under Report Criteria on the Edit Report page of a saved report, and in the criteria settings of lists and tags.
To build criteria, add a group, add one or more rules to that group, and set an object, a field, an operator and a value for each rule. Add more groups or sub groups when a single set of rules does not describe the selection you need.
On this page, the following topics are covered:
- How are criteria structured?
- Which operators can you use in a rule?
- How do you combine groups with AND or OR?
- How do you exclude records from the results?
- How do sub groups work?
- Example: select contacts who live in Amsterdam or London
How are criteria structured?
Criteria in Spotler CRM consist of groups, and each group contains one or more rules. A rule is a single condition, such as "the country is the United Kingdom". Within a group, rules are always combined with AND: a record must meet every rule in the group. This cannot be changed. You find groups and rules in the criteria builder: under Choose Criteria in the Segmentation step of a new report, under Report Criteria when you edit a saved report, or in the criteria settings of a list or tag.
The criteria builder uses three building blocks:
- Group: a set of rules. Click Add group to add a group.
- Rule: a single condition within a group, made up of an Object (for example Account or Contact), a Field of that object (for example AddressCountry), an Operator and a Value. Click Add rule to add a rule to a group.
- Sub group: a group inside another group, used to add a separate set of rules to a larger selection. Click Add sub group to add one.
To remove a rule or a group, click the trash can icon next to it. There is no limit to the number of rules or groups you can add.
Which operators can you use in a rule?
An operator defines how the criteria builder compares a field with a value, for example whether the field must be equal to the value or must not be equal to it. You choose the operator under Operator in each rule, after you select the object and the field.
The operators available depend on the type of field you select:
- Equal to and Not equal to: the field must match, or must not match, one specific value.
- Is one of and Is not one of: available for dropdown fields. You can select more than one value, for example several countries.
- Date fields have their own operators, such as During, and support dynamic dates like This Week or Last Month. Date operators are explained in How do I use relative date filters?
In reports, you can also turn a rule into a runtime criterion with the Runtime checkbox, so that you choose the value each time you run the report. Runtime criteria are explained in How do I use runtime criteria?
How do you combine groups with AND or OR?
AND and OR define whether a record must match all groups or at least one of them. As soon as you add a second group with Add group, a dropdown appears between the groups. It is set to AND by default.
Choose one of these options in the dropdown:
- AND: a record must match both groups.
- OR: a record must match at least one of the groups.
To create a group with rules similar to an existing group, click the copy icon at the top right of the existing group and adjust the rules in the copy.
How do you exclude records from the results?
An exclude group removes records that match the group from the results, instead of adding them. Every group and every sub group has an Exclude Group checkbox at the top. Excluding always requires a separate group or sub group: the rules for the records you want to leave out go into their own group, apart from the rules for the records you want to include.
To exclude records:
- Click Add group to add a separate group, or Add sub group to exclude records within an existing group.
- Add the rules that describe the records you want to leave out.
- Select Exclude Group at the top of that group or sub group.
For example, to select all customers except the ones who visited your website in the last month, create one group with the rule that the account type is one of Customer. Then add a second group with a rule for website visits in the last month, and select Exclude Group for that second group.
How do sub groups work?
A sub group is a group inside another group. Use a sub group to combine AND and OR in one selection, in the same way you would use brackets: the rules of the parent group AND (sub group 1 OR sub group 2). In reports, you add a sub group with Add sub group at the bottom of an existing group. In lists, you add a sub group with the sub group icon next to a rule.
Sub groups follow these rules:
- The rules of a parent group and its sub groups are always combined with AND.
- Between sub groups, you choose AND or OR.
- A sub group can also be an exclude group. Select Exclude Group at the top of the sub group to remove the records that match it from the parent group.
- A sub group has its own Add rule and Add sub group buttons, so you can add sub groups within sub groups. There is no limit to the number of levels.
- When you copy a sub group, the copy appears directly below the original, within the same group.
A step-by-step example is shown in Example: select contacts who live in Amsterdam or London.
Example: select contacts who live in Amsterdam or London
You want to select contacts who are not on hold, do not have a global opt-out, have a total account score greater than 100, and live in either Amsterdam or London. The criteria builder in Spotler CRM handles this with one group and two sub groups:
- Click Add group and add three rules: the contact is not on hold, the contact has no global opt-out, and the total account score is greater than 100.
- Click Add sub group in this group and add the rule that the city is equal to Amsterdam.
- Click Add sub group again and add the rule that the city is equal to London.
- Set the dropdown between the two sub groups to OR.
The result contains every contact who meets all three rules of the parent group and who lives in Amsterdam or in London.
The same criteria builder for reports, lists and tags
The criteria builder works the same way in reports, lists and tags in Spotler CRM. In lists and tags, you use it to set the criteria for a dynamic list or tag, and to add or remove records in a static list or tag. Still working with the legacy editor? Criteria in the legacy editor are explained in How to use Criteria Fields in reports? (legacy editor).