For each row in data table error message

I am trying to automate an auditing confirmation process. However, this error message pops up (for each row in data table: object reference not set to an instance of an object) and I am not sure how to solve it or where the problem lies at


Check weather the Datatable1 gets duplicated by seeing them in variable pane

If yes delete the duplicated variable from the variable pane!


1 Like


This error means that one of your variables is null. Run your code in debug up to the activity that breaks and check the locals panel for a null variable.

1 Like

Use Debug to see exactly which activity is throwing the error.

1 Like

Dear Mandy,

Your Datatable is empty and not initialized for which it may be throwing error.
Could you keep a debug point there and check the contents of the datatable(count of rows,data).

If possible please send a screenshot of the activity where you are populating the table.

Geetishree Rao

1 Like

if you provide the Header name does it work? it has to know on which column to iterate

1 Like

For Each loops don’t iterate columns, they iterate rows.

they iterate rows but only on one column that you need to select

By the way, get rid of all those Get Row Item activities or whatever they’re called. If you want the value for “Audit Client” just do CurrentRow.Item(“Audit Client”).ToString