NOT( [YesNo?] ), to return TRUE, when [YesNo] is blank

Given a Yes/No type column, that is left blank, and then wrapped in a NOT() expression, the result is currently FALSE.

I would expect this to return TRUE. This is common behavior in most, if not all, of the languages I am familiar with.

Status Open
1 6 185
6 Comments
Marc_Dillon
Platinum 1
Platinum 1

[column] should return FALSE, if it is a Yes/No Type, and if it is blank. This really bothers me that it doesn’t .

Steve
Platinum 4
Platinum 4

Attn @natalie

Status changed to: Open
Pratyusha
Community Manager
Community Manager
 
Marc_Dillon
Platinum 1
Platinum 1

Having been reminded of this request just now by @dbaum tagging me and linking to this in his other thread here, I must say that I no longer believe this is an appropriate request. At the time the request was made, I was very familiar with programming languages, but not very familiar with database concepts. Having learned more about databases since then, I've come to understand one point in particular:

A NULL value is its own special case, and is not equivalent to anything else, even itself.

To explain that further, a NULL value means that the value is unknown. This is much different than the confirmed absence of a value. A text value can be NULL, or it can be a blank string "", and these 2 things are very different and not equivalent. Similarly, a Boolean value can be NULL, or it can be FALSE, and these 2 things are also not equivalent.

As Appsheet generally follows database concepts, instead of programming language concepts, I no longer feel that NOT( [column] ) should equal TRUE, when [column] is a Yes/No type without a value.

For more reading on the subject, I recommend a Google search as such:

https://www.google.com/search?q=sql+blank+vs+null

SkrOYC
Gold 5
Gold 5

I'm changing a big part of my apps because I can't leave a YN value as Blank, it always return to N

dbaum
Gold 4
Gold 4

FWIW, I've found it handy to manage some boolean columns as having 3 possible values from the AppSheet perspective: true, false, or blank. The main use case is to distinguish between:

  • rows for which the column hasn't yet been populated (i.e., I leave the initial value property empty) because the row hasn't reached the pertinent stage in the typical lifecycle for that table's rows
  • rows for which something has occurred that led to populating the column as either true of false

As long as I'm aware of scenarios where I need to distinguish between NOT([Boolean Column]) and the more explicit [Boolean Column] = false, I think the approach is working out.