Reading blank cell from excel

Hi,

I am reading values from an excel sheet and it is working fine if the cell is valued however throwing error “Object reference not set to an instance of an object” if the cell is blank. I have attached a sample flow showing this error. Any help on it would be much appreciated.

Sample.zip (8.8 KB)

Thanks

You can add a condition like below

If String.IsNullOrEmpty(strTest) Then
  -- String contains null
End If
1 Like

hi there…,

Going through your XAML I found two things.

Your condition 'cellValue.Trim=" " ’ there is a space in your condition after the trimming the string so you should indicate a string without spaces to check for an empty string. (Or you can try IsNullOrEmpty / IsNullOrWhiteSpace if you are so inclined towards checking for white space.)

The second one, is instead of doing a separate activity of getting the row item using the column name I have attached a sample which might help your perspective of whatever you are trying to achieve (Which I might add uses the Column name to check for the incoming value) . : Sample.zip (29.9 KB)

Hope this helps.

Regards :slight_smile:

Thanks Karthik, It worked!

1 Like

Thanks Raghav for all the explanations! I have made suggested updates in codes and it is working now.

Glad it worked. Your’e welcome. Mark solution and close this topic :slight_smile:

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