Datarow Null exception

Below is the error tab

Below is the code

Excel Sheet

How to sole this

Thanks and Regards,

Where is the datatable test coming from?
are you just declaring it or reading it from somewhere

Just declaring it

Thanks AND regards,

So thats the error, You need to declare the data table with the number of columns that you are inserting, Or else you will get a null reference exception. Just use build data table with those number of column names.(before doing the add datarow) :slight_smile:


one more query every time in a loop if I add datarow it will add to a new row?

How to updatee a single column of an excel in a loop

Thanks and Regards,

Yes, you can use the add data column activity to update a single column.:slight_smile:


1 Like

Happy learning :slight_smile:


I m using for each row so for the first row I have to update a column of that row itself in the excel
but using add datarow it is entering the value to next row of that column

Thanks and Regards,

WHile using for each row, If you want to input value to that column do → row(“Columnname”)=“Value”


I have a if condition so if that is true then for each row starts where i have to update an excel say test but if the if condition is false also i have to enter the data in same excel test

so do I have to use 2 write range because if I use write range in for each then other condition is not satisfied…

Thanks and Regards,

dont use write range in that. Use assign and atlast after the foreach put write range

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