---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/cohorts/cel/null-handling#article
headline: Null handling
description: Learn how Twilio Cohorts filter criteria handle traits that are missing from a profile.
url: https://www.twilio.com/docs/cohorts/cel/null-handling
inLanguage: en
dateModified: 2026-09-15T09:58:28.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# Null handling

## Missing traits don't raise errors

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.

```txt
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"`.

## Checking for presence

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

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

## `null` in output

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.

## Next steps

* Review [supported operators and precedence](/docs/cohorts/cel/operators-and-precedence).
* Learn about [type matching](/docs/cohorts/cel/type-matching).
* Review [example criteria](/docs/cohorts/cel/common-filtering-patterns) for common filtering patterns.
