Solved

How does Klaviyo handle boolean fields that aren't set?

  • 11 August 2023
  • 7 replies
  • 145 views

Userlevel 4
Badge +7

Hey all,

If we have a boolean profile property and it’s not set, does that evaluate to false?

If I wanted to create a conditional split in my flow for anyone where the boolean field is false or not set, do I need to add both “is false” and “is not set” or will “is false” suffice?

In dev terms, is “is false” a strict check (“===”) or a loose falsy check (“==”)

Let me know.

Thank you.

 

icon

Best answer by KeviSunshine 11 August 2023, 21:49

View original

7 replies

Userlevel 2
Badge +5

I’ve not run into this issue with a boolean yet, but I definitely add the appropriate “is not set” check for various numeric fields (some of which are effectively being used as T/F bits)

 

 

Userlevel 5
Badge +18

@KeviSunshine 

Profile properties don’t exist on all profiles, only the ones that it gets added to. So unless you’re actively updating users with False on that property, it just won’t exist. 

 

If memory serves, there isn’t actually a NOT SET option for boolean fields, so you’ll have to do the opposite. Look for the TRUE value on the split and then send the rest down the NO path. 

 

Userlevel 4
Badge +7

>If memory serves, there isn’t actually a NOT SET option for boolean fields,

That is correct.

So I will need to do something like @stem is showing: “IS FALSE” OR “IS NOT SET”?

Userlevel 5
Badge +18

@KeviSunshine  Unfortunately, what @stem  is showing only works on certain fields. It does not work on Boolean fields. When you go to add the boolean profile property, the only options you’ll have are True or False. You can’t say IS NOT SET. 

 

So Instead, you’ll want your conditional split to say Boolean Field is TRUE. 

Then the emails you intend to send to the False group would be added to the NO path of the conditional split. 

Userlevel 2
Badge +5

I get around the lack of “is not set” for other data types by checking as if it were TEXT. You can see that in my example. My segments are riddled with this.  Seems to work for date fields as well. Check against the dates that exist and then pretend it’s a TEXT and check “is not set”

In my mind the TEXT:IS NOT SET is used in contexts where I’d use IS NULL as a distinct check from NOT EQUAL.  

Userlevel 4
Badge +7

@stem this is exactly what I’ve been doing to be safe, and I was just curious if it was necessary :)

Based on this convo, I believe it is necessary and that Klaviyo treats boolean checks as strict checks.

 

Userlevel 5
Badge +18

@stem Awesome, good to know - thanks! 

 

 @KeviSunshine Looks like you have two options here. Either include OR is NOT SET (Telling the condition that it’s a text based field instead of a Boolean) OR look for the true value and send your emails down the NO path. 

Reply