Returning an “empty” value from a Notion formula is easy. Just use empty() as the return value:
empty() /* Output: empty (e.g. no output) */Code language: PHP (php)
This is a useful trick for adding if-then cases to formulas that need to retain a single return data type:
if(
prop("Number") == empty(),
empty(),
today()
)
Code language: JavaScript (javascript)
In the past, we used to have to do weird tricks like "".parseDate() to get truly empty return values while retaining a single return type in a formula. No longer!
You can do other cool stuff with empty, so I’d recommend familiarizing yourself with it.
