How to avoid null reference exception in if loop

Hi,
I want to avoid null reference exception while validating the excel.

1 Like

try this…Take one “IF” condition or “Flow decision” and put this condition

String.Isnullorempty(“YourVariable”)

Accordingly you can proceed with your workflow after checking its null or empty.

1 Like

In addition to @syedabidraza thoughts you need to check first if your datatable in excel has value on it or not.Dattable.row.count > 0 then proceed else dont proceed @raghuramk

cheers :smiley:

Happy learning :smiley:

1 Like

if the value exist or empty it directly going to the false block @syedabidraza

1 Like

if the value is empty , it will go to true part , and if its not empty than it will go to false part…please share screenshot ,how you have written this condition…

1 Like


It showing false instead of true

1 Like

company code is the variable which is already available , no need of giving it in inverted commas(" ")

1 Like

thank you it’s working

cheers

1 Like

Please mark the answer as solution if it helped!!

Thanks.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.