How to resolve the issue Error: Cannot convert null to an object?

Sujitha5
Kilo Contributor

hello,

I am currently working on the Flow designer actions named Lookup Records.

I am trying to get values from a previous step and initializing it on the script step. Where the value from the table is null

currentAlertCorpName -> this value is taken from a table called Accounts. but the value is null

I want to use this null value on the script but i couldn't use as it throws an error Error: Cannot convert null to an object

var corpName= inputs.currentAlertCorpName;  //Which is begin initialized like this in the script.

 

How can i convert this null to an object and use it in the script for if conditions?

 

1 REPLY 1

Ravi Peddineni
Kilo Sage

In the Inputs section of your action, uncheck mandatory option if checked & change the field type to String. So that the field accepts the empty value. And later in your Script step you can glide record to table and get the record if the value is not empty.