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:
-
IfBlank
is conceptually quite different fromIfNotBlank
. InA.IfBlank(B)
,A
is the value of interest so to speak, andB
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 ofA
is when it is one single boring value ofBlank
.B
is now the value of interest and it just gets forced blank whenA.IsBlank()
. -
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 justBlank
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
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.