Skip to contentSkip to navigationSkip to topbar
Page tools
Useful for sharing or LLM
Accelerate development with AI

On this page
Looking for more inspiration?Visit the

Common filtering patterns


Filter by a single trait

filter-by-a-single-trait page anchor
profile.trait.Account.plan == "enterprise"

Combine multiple trait conditions

combine-multiple-trait-conditions page anchor
profile.trait.Account.status == "active" && profile.trait.Account.country == "US"

Exclude profiles that match a condition

exclude-profiles-that-match-a-condition page anchor

Use ! to invert a condition. Field access has higher precedence than !, so you don't need parentheses around a single field reference.

!profile.trait.Account.isTest && profile.trait.Account.status == "active"

Match against a list of values

match-against-a-list-of-values page anchor

Use in instead of chaining several == comparisons with ||.

profile.trait.Account.country in ["US", "CA", "MX"]

Because address references always return lists, check for membership or presence instead of comparing them directly to a string.

"jane@example.com" in profile.address.email
has(profile.address.phone)

Combine a trait condition with an address condition

combine-a-trait-condition-with-an-address-condition page anchor
profile.trait.Account.status == "active" && profile.address.email.exists(e, e.endsWith("@example.com"))

profile.trait.Account.lifetimeValue >= 100 && profile.trait.Account.lifetimeValue < 1000

Guard a comparison with a presence check

guard-a-comparison-with-a-presence-check page anchor

If a trait might be missing and you want to exclude those profiles explicitly, pair the comparison with has().

has(profile.trait.Account.lastPurchaseDate) && profile.trait.Account.lastPurchaseDate > timestamp("2026-01-01T00:00:00Z")

Combine values with arithmetic

combine-values-with-arithmetic page anchor

You can also apply arithmetic operators to combine multiple traits into a single derived condition.

profile.trait.Account.lifetimeValue - profile.trait.Account.totalRefunds > 500
profile.trait.Engagement.emailOpens + profile.trait.Engagement.smsClicks >= 10

Match a concatenated string

match-a-concatenated-string page anchor

String concatenation with + lets you build a composite value to compare against.

profile.trait.Contact.firstName + " " + profile.trait.Contact.lastName == "Jane Doe"

Filter with a conditional expression

filter-with-a-conditional-expression page anchor

Use the ternary operator (?:) when the condition you want to filter on depends on another trait. It evaluates a condition and returns one Boolean when it's true and another when it's false.

profile.trait.Account.plan == "enterprise" ? profile.trait.Account.lifetimeValue > 10000 : profile.trait.Account.lifetimeValue > 1000

  • Review operators and precedence when combining several conditions.
  • Review the complete functions reference.