Add an IfNotBlank() formula

Hi Connor, it seems to me the pattern you want to compress into one formula is:

If(IsBlank(A), "", B) ⇒ A.IfNotBlank(B)

There are two reasons I don’t think this is a good idea:

  1. IfBlank is conceptually quite different from IfNotBlank. In A.IfBlank(B), A is the value of interest so to speak, and B is like an alternative default. Ie, "I want the value A, but if it doesn’t exist, then just use B instead. A.IfNotBlank(B) on the other hand is a different beast. Now, the only way I get an output of A is when it is one single boring value of Blank. B is now the value of interest and it just gets forced blank when A.IsBlank().
  2. There is a hidden third argument. When I read A.IfNotBlank(B), then I know that “If A is not blank, then B is the output.” However, it’s not immediately clear what the output should be if A is blank. Of course in some cases you may argue it really should be just Blank but I bet there are other circumstances where you may prefer a default value more like 0 or false… or any arbitrary value for that matter.

So in my mind, it is better to write out the full and explicit logic, and tweak it as you may:

If(IsBlank(A),
  C,  // where C is `Blank` or 0 or anything else
  B
)

Anyway, my arguments are kinda feeling based, so feel free to feel differently :smiley:


As an aside, in the particular example you wrote, I feel your pain about this error. I hope we get a solution to your other suggestion.

2 Likes