Empty datatable keeps giving error

Hello,

I have an empty data table - if the data table is empty I would like the process to continue. I have configured like this:

image

The issue I am having is that I am getting an error: ‘Object reference not set to an instance of an object’ because the data table is empty therefore my If statement does not run at all.

Anyone know how to edit the code in order to make the If statement run with an empty data table?

Hi @E.T.S

Can you try the below syntax in If:

IsNothing(dt) OrElse dt.AsEnumerable.All(function(x) x.ItemArray.All(function(y) String.IsNullOrEmpty(y.ToString)))

Regards

That works thank you!

1 Like

You’re welcome @E.T.S

Happy Automation

Regards

1 Like

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