Marketo Booleans are nullable, but don’t worry about it too much

A user asked about this mysterious-sounding warning in the Trigger Smart Campaign docs:

Sounds scarier than it should because something’s omitted. The missing link? It’s that Boolean fields have 3 possible values: true, false, and null.

null enables more business cases

Nullability lets you distinguish — at least in theory — an unknown or unset value from a value that is known one way or the other.

Among infinite examples:

  • opt-in fields: responding “No” (false) is different from not having been asked the question (null)
  • fields like Is Partner before records are linked with external data: knowing somebody is not a partner (false) is different from not yet knowing (null)

In practice, though, only some Marketo features distinguish false and null.

Sometimes true and false are the available options and null doesn’t match either one, which is strict comparison.[1] Other times null is temporarily treated as false, a loose comparison.

Overall, we can say Marketo is always null-preserving, because if you can explicitly set null, the value is stored in the database. But it’s not always null-strict. (Yes, it’s confusing. That’s why your internal Tips ’n’ Tricks doc is so key.😊)

What the warning means

The warning above refers to one specific case: setting a value to null doesn't trigger Data Value Changes to false.

Say you use a Flow step to set null[2] or call the Sync Lead API endpoint like so:

{
  "action" : "updateOnly",
  "lookupField" : "id",
  "input" : [{
    "id" :  123456,
    "isPartner" : null
 }]
}

Regardless of the previous value, this Smart Campaign trigger will not fire:

This trigger also will not fire, despite attempting to compare to null:

Yet — assuming the previous value was true, of course — this trigger will fire:

As you can see, nullability adds vital flexibility to the Marketo database, yet can cause surprises[3] if you don’t test thoroughly.

Notes

[1] It’s not usually possible to compare a field value explicitly to null within Smart List Filters and Flow Choices. But you must prepare for those comparisons in REST API-based apps, which will see the preserved null values in the language of your choice.

[2] You might not realize Change Data Value can set null. Though the dropdown just shows true and false, you can type it manually:

[3] There’s a whole world of interesting behavior with Custom Objects + null fields + Velocity, which I’ve written about before.