What is the recommended way to deal with potentially null arrays when running a script as part of an automation?
I’m setting up an automation flow that runs a script and as part of the script I’m calling record.getCellValue()
which oftentimes will be null. When using the scripting block, I’ve handled this by using the nullish operator, like this:
let array = record.getCellValue() ?? (];
That way I always have an array, even if empty, and not null.
When trying to re-create that script in an automation though, I get this error:
I would’ve expected both scripting environments to have the same support. Am I missing something here? And if ??
isn’t supported, what’s the best way around it? I’m working with a lot of arrays so would like something succinct.
Thanks for any help