Advanced filtering
Advanced filtering with AND/OR logic
With more advanced filtering features, you can express audience logic that cannot be represented by a flat list of filters.
Use these when you need to target participants who match one of several valid paths, such as:
- participants resident in one of several countries
- participants in a participant group who fall within a target age range
- participants who took a previous study and passed a screener, or participants who have not taken that study yet
How filter logic is evaluated
A study or filter set can contain leaf filters and composite groups.
Leaf filters are the standard select and range filters. See Filters Overview for examples of each.
Composite groups use filter_id: "and" or filter_id: "or" and put their child filters in selected_filters.
and: every child filter in the group must match.or: at least one child filter in the group must match.- A flat list of top-level filters is treated as an implicit
and.
Flat OR within one attribute
For a select filter, multiple selected_values means “match any of these selected values”. The values are the choice IDs returned for that filter by the filters list endpoint.
For example, this selects participants resident in either of two countries:
You can use this form to simplify the query when the OR choices all belong to the same filter attribute.
OR across different filters
To match participants who satisfy one of several different filters, you can wrap the leaf filters in an or group.
For example, this matches participants who are either in the participant group or aged between 18 and 30:
Nested AND/OR groups
You can use nested composite groups when each OR branch has its own AND requirements.
For example, this matches participants who are either:
- in the participant group and aged between 18 and 30
- in the previous study allowlist and have an approval rate of at least 95
Saved filter sets
Compound and / or groups like the examples above can be saved as a filter set and reused across studies. See Filter Sets for how to create, version, and apply them.
Limitations
Compound and / or filter groups are not currently supported for Quota or Representative Sample study types.