Okay, so I am getting error Column “Row” does not belong to table when apparently there is a column with that name “Row” with no space in the front and back.
I first read from Excel sheet, with output being dt_ReadFromExcel and I added a new column named “Row”. It works fine. When I print the resultant table using Write Range activity, I see the new column “Row” at the end of the columns.
Now, I have created another table dt_Result which is going to store filtered data from dt_ReadFromExcel.
Inside a for-each loop:
For each row in dt_ReadFromExcel,
I am using Add Data Row activity to add a row data to dt_Result DataTable, where I gave ArrayRow property the value of row.Item(“Row”)) as a part of it.
When I run the program, I get error from this Add Data Row saying Column “Row” does not belong to table.
It looks to me that it is saying that each row inside dt_ReadFromExcel does not have a column with name “Row”, but it does exist. I used Write Range right before Add Data Row activity, and it does print “Row” column too.
I don’t understand why it gives out this error. I am at my wits end with this.
Since this is a project for my work and I cannot upload the work project file, I took screenshots.
Also, in the actual project I am using different variable names, so I modified them in the screenshots.
I am going to upload screenshots showing the following processes:
(1) Read from excel sheet, and save the datatable out to dt_ReadFromExcel.
Edit: As you can see from (2) and (3), I am adding “Row” column to the table, and it works fine.
I am even using row.Item(“Row”) in (3), and it is working.