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

Null handling


Missing traits don't raise errors

missing-traits-dont-raise-errors page anchor

You can't use the literal null in filter criteria. When a profile doesn't include a trait that your criteria reference, any comparison against that trait evaluates to false. The profile is therefore excluded from the results instead of causing an evaluation error.

profile.trait.Account.status == "active"

A profile with no Account.status trait doesn't match this condition. It is excluded, just like a profile whose Account.status is set to any value other than "active".


To distinguish "the trait is missing" from "the trait doesn't equal this value," use the has() function.

has(profile.trait.Account.status) && profile.trait.Account.status != "active"

Although null isn't valid inside filter criteria, a missing trait can still appear as the JSON value null when it is projected into a snapshot through snapshot variables.