Hi,
I am facing an Object reference not set to an instance of an object:Assign. I create csv files and intend to put the information (file name etc.) based on a folder, into a csv file. I managed to write line the files in the folder, but when I use the “Add Data Row” Activity and “Append CSV” activity. I am getting the error. I tried to invoke a macro as well, but the same error occurred. Is there any solution to this?
Make sure before adding a row with Add Data Row activity, your datatable variable should be initialised and should not be null.
Welcome @Jacqueline_Neo to the UiPath Community
Its essentially these 4 steps:
Step 1: Initialise New Data Row
Create a new variable called “drNewRow”. Must be of type “System.Data.Datarow”.
Step 2: Assign New Row to your Datatable
drNewRow = dt1.NewRow
Step 3: Insert Data to Row (by column values)
drNewRow(“COLUMN”) = yourValue
Step 4: Add Completed Row to DataTable
Insert “Add Data Row” activity
Update DataRow with: drNewRow
Update DataTabe with: Dt1
Check the steps in this tutorial at 6:00:
Cheers
Steve
Hi Steve,
I already initialized my variables, but I am still getting the same
error, any other solutions?
Do all the columns exist?
Has the datatable been initialised?