. operator, with the exception that it short-circuits and returns
Blank if the left hand side expression of the operator is
Syntax could be anything, does not need to follow the JS approach (although I believe it is supported by many languages), as long as the semantics is the same.
This would enable simpler checking of blank values.
It is even more beneficial when navigating multiple layers, such as the properties of a lookup row.
Please let me know if this is already possible, or even needed.
I’ve been looking for something similar for a while now. I find the
If syntax to be a bit ugly when used merely to check if something is not blank.
I wrote about something similar here:
There is no IfNotBlank() formula. Which is a problem because IfBlank().Not() does not have the same functionality as IfBlank().
X.IfBlank(value) will return value if X is blank. X.IfBlank().Not(value) is just an error.
But I was ultimately dissuaded and instead I landed on:
When checking whether a formula has errors, only throw Unexpected dot operator error if that line can be logically reached.
Right now, when you write the formula:
If variable is blank it displays this error:
I want it to return false.
You can play with it here:
This matters because there are scenarios where you have a variable that is normally not blank and is used in a subsequent calculation. If it is ever l…
Here’s a doc showing another place I’d like to use something like this for:
In this doc I propose the idea of
IfBlankReturnOtherwiseDo operator (terrible name, but you get the idea). You would use it in your code like this:
What possible names | syntax can you think of for the ? operator?
I’ve read the topics you linked and I agree with the proposed changes agreed upon there. I don’t think it’s exactly the same scenario however.
Ultimately, just playing around with an example, it seems the
. operator already handles optional chaining implicitly. Should have checked before making this topic
Here’s the example:
As you can see it does not complain for both approaches retrieving the nested field, as the
. operator will automatically shortcut and return Blank if the LHS is Blank.