For Each Row in Data Table: Object reference not set to an instance of an object

Im passing an in arguement a datatable, and I want to get the each row to string

Hi @mauricio_Villanueva ,

I think we are getting empty rows in data table that’s why it is throwing object not reference error.

Could you check the datatable having rows or not by locals while running the process of use log message and count the number of rows available in dt in_dt_Data_News.rows.count.tostring

And also check you are having datatable in both argument and variable in this case having datatable in both areas will nullify datatable.

Please debug why we are not getting any rows. Thanks.

1 Like

Hi @mauricio_Villanueva

This error usually error when your input datatable have some empty columns

Kindly remove or fill the empty column and try again

Hope it solves your issue

Thanks
Robin

1 Like

Hi @mauricio_Villanueva,

Welcome to the community.

In the variable panel where this dt is declared, in the value section write - New Datatable()

Thanks

1 Like

Thanks for your advises and tips to solve this.

I don’t know why. At the first run this sent me this error but at the second time run it well.
Maybe in the first run had an error to got the data from the web page.

But thanks for the tips:

  • Have the same type of variable / argument
  • Count the datatable rows (“NameDataTable”.rows.count.tostring)
  • Variable write in value section (New Datatable())