String NULL Then ""

I’m reading a lot of parameters into an excel file. But some parameters are NULL. So when I do → assign StringVar = row(“parameter”).toString ← Throws and error.

I want to know if there is a way to ask into and assign like this without using if activity:

ASSIGN StringVar = row(“parameter”).toString but if String.IsNullOrEmpty(row(“parameter”).toString) then value= “”

Thank you for your time

1 Like

yah we can in assign activity with this expression
stroutput = IF(String.IsNullOrEmpty(row(“parameter”).ToString),string.empty,row(“parameter”).ToString)

Cheers @KevinDS

Hi,

I suppose String.IsNullOrEmpty(row(“parameter”).toString) is not very good because there is a possibility row(“parameter”) is null.

So, can you try the following sentence?
ASSIGN StringVar = If( row(“parameter”) IsNot Nothing, row(“parameter”).toString, "")

Regards,