Merge Datatable adds equally named columns or throws error "missing definition for column"

Hi Community,

I want to merge two datatables.
The first one is setup by a blank datatable, and then I am adding the columns in a for-loop to the datatable using the “add column” activity.

The second one is read from an excel file.
The column names are completely equal, as well as the datatype of the columns.

When using the merge command and the “missingSchemaAction” ‘Add’, the activity adds two columns to the table which have the same name as the existing columns.
So e.g. :
Original columns [Column-0],[Column-1],[Column-2]. The second datatable also has these column names. After merging, it gets
[Column-0],[Column-1],[Column-2],[Column-1],[Column-2]

When using the merge command and the “missingSchemaAction” ‘Ignore’, no values are added in the rows.

When using the merge command and the “missingSchemaAction” ‘Error’, the following error message appears:
Target table DataTable missing definition for column [Column-1].

I already checked all the properties but couldnt find a difference.

Can somebody help me here?

Hi @BennyS ,

This does not seem to be a possible case as there cannot be columns with same name in the one datatable.

Try checking the values of the column names, there must be a space or a different character added to it.

If you could show/Check in the Debug panel, we could further confirm or analyse on this.

@BennyS

Check below post for your reference

Hope this may help you

Thanks,
Srini