Column "XXX" does not belong to table

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.

@tomato25 Can you upload your workflow?

Buddy may i know how this was done…i think there must be some issue here…can i have screenshot at this point in your workflow…
Cheers @tomato25

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.

(2) Add a column “Row” to dt_ReadFromExcel

(3) Add row numbers to “Row” column, using a for-each-row loop.

And this is the resultant table that I displayed using Write Range activity.

So the “Row” does exist.

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.

That was good
So where you are facing the error like no column “Row” is there like that,

Cheers @tomato25

1 Like

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