Combining filters with And and Or, and choosing the right operator
Filters decide which contacts something is for: who's on a contact list, who sees a reward, who goes into an automation. Every filter builder in the dashboard combines filters the same way, so the rules below work everywhere you meet them.
Where you'll find filters
- On a contact list, under CRM → Lists. See Creating a contact list.
- On a reward, under Visibility filters. See Showing a reward only to certain contacts.
- On the Start step of an automation, and on each branch of If/Then branching. See How to build an automation.
- On a tier, under Entry criteria once you switch on Enable additional criteria. Only Contact filters are available there. See How to configure loyalty tiers.
- On a narrowcasting slide for the Business App. See Showing images on your Business App tablet (narrowcasting).
Contact lists have the most options: they can also filter on orders, bookings, visits, voucher redemptions, form submissions, wallet passes and email engagement, and they have a few extra date operators. Those are marked below.
How filters combine
- Filters in the same group are joined with And. A contact has to match every one of them.
- Groups are joined with Or. A contact who matches any one group is in.
On a contact list, click Add filter inside a group to add a filter to that group, and Filter group below the groups to start a new one.
So put conditions that must all be true in one group, and alternatives in separate groups. For example:
- Group 1: Tier is Gold, and Last transaction date is more than 30 days ago.
- Group 2: Points balance is greater than 500.
This finds Gold contacts who haven't had a points transaction for more than 30 days, plus every contact with more than 500 points, whatever their tier. With all three filters in one group, you'd only get Gold contacts with more than 500 points who've been away for 30 days.
The most common mistake is the other way round: two filters in separate groups when you meant both. You then get everyone who matches either one, and the list comes out far bigger than you expected.
What a filter is made of
- Filter type: what you're filtering on. Usually Contact. A contact list also offers Order, Booking, Visit, Voucher redemption, Form submission, Wallet Pass and Marketing.
- For a Contact filter, how you pick the contacts:
- Select an attribute: anything stored on the contact, from built-in attributes like Tier, Points balance and Last transaction date to your own custom attributes. On a contact list this also includes List memberships and Segment memberships.
- Select contacts: specific contacts you search for and pick.
- Relations: contacts in one of your Contact lists, or with an Associated business profile.
- Contact type: only there when you have more than 1 contact type.
- The operator: how the value is compared, such as is equal to or Is more than X days ago. Which operators you get depends on the attribute's data type, listed below.
- The value to compare against. Operators like Is known and Is today don't need one.
What the built-in attributes mean is in What a contact's built-in attributes mean. For your own, see Custom attributes: what they are, how to create one and where to use them. Every field the Order, Booking, Visit, Voucher redemption, Form submission, Wallet Pass and Marketing filters offer is listed in Creating a contact list.
More than one condition in a filter
On a contact list, one filter can hold several conditions: click Add condition in the filter's panel. Once there are 2 or more, Match sets how they combine. All means every condition has to hold, and Any means 1 is enough.
On an Order, Booking, Visit, Voucher redemption, Form submission or Wallet Pass filter, All means one and the same record meets every condition. Total order amount greater than 50 together with Location set to your Amsterdam store finds contacts who placed an order over 50 in Amsterdam. It doesn't find contacts with a big order somewhere else and a small one in Amsterdam.
To filter on what was in the order, open Related and then Product in the order filter. Voucher and Reward under Related filter on the voucher or reward used on the order.
Each of these filters has a count: Number of orders, Number of bookings, Number of visits, Number of redemptions, Number of submissions and Number of wallet passes. It counts only the records that match the filter's other conditions. Number of orders at least 3 with Location set to one store finds contacts who ordered there 3 times or more. Number of orders equal to 0 on its own finds contacts who never placed an order. With other conditions, it finds contacts who have no order that matches them.
On a Marketing filter, every condition is about the one campaign, email or subscription you picked. Received is true together with Opened is false finds contacts who got the email and didn't open it.
Operators for each data type
- Text, and email, phone, URL and identifier attributes: is equal to, is not equal to, Contains, Does not contain, Is known, Is unknown.
- Numbers: is equal to, is not equal to, Greater than, Is greater than or equal, Smaller than, Is smaller than or equal, Is known, Is unknown.
- Dates: Is today, is equal to, is not equal to, Before, is on or before, After, is on or after, Is exactly X days ago, Is less than X days ago, Is more than X days ago, Is exactly x days from now, Is less than X days from now, Is more than X days from now, Is known, Is unknown. On a contact list, dates also offer Is this week, Is this month, Is last month and Is this year.
- Birthdates: Is today, Is in exactly X days, Is exactly X days ago, Is less than X days ago, Is more than X days ago, Is known, Is unknown.
- True or false: Is true, Is false, Is true or unknown, Is false or unknown, Is unknown.
- Select: is equal to, is not equal to, Any of the values, None of the values, Is known, Is unknown.
- Multi-select: Any of the values, None of the values, is equal to, Is known, Is unknown.
Order, Booking, Visit, Voucher redemption, Form submission, Wallet Pass and Marketing filters offer a shorter list for their fields, without Is known and Is unknown.
A few that are easy to mix up:
- Is more than X days ago means longer ago than that. Last transaction date is more than 30 days ago finds contacts who haven't had a points transaction in the last 30 days. Is less than X days ago means within the last X days.
- Is this week, Is this month and Is this year mean the current calendar week, month or year, so from the 1st of the month rather than the last 30 days. A week runs Monday to Sunday. Is last month is the whole previous calendar month. A list that uses them changes at the nightly rebuild when a new week, month or year starts.
- Is unknown means the contact has no value at all. Is false skips those contacts. Use Is false or unknown to include them.
- Last transaction date is about points transactions, earning or spending, and not about orders. To select contacts on their orders, use an Order filter on a contact list.
What you can't filter on
- The answers in a form submission. A Form submission filter on a contact list knows which form a contact filled in, not what they filled in. To filter on an answer, add a contact attribute to the form so the answer is saved on the contact, then filter on that attribute.
- A contact's order history, bookings, visits, voucher redemptions, wallet passes or email engagement, anywhere other than a contact list. To use one of those in a reward's visibility filters or an automation's If/Then branch, put the contacts in a dynamic list and filter on that list with Relations and Contact lists.
Check your filters before you rely on them
- On a dynamic list, Options and then Test checks whether one contact passes. On a reward, use Test under Visibility filters.
- A dynamic list stays empty until you click Activate. If a new list shows 0 contacts, check that first.