<target>ColumnName and <source> ColumnName have conflicting properties: DataType property mismatch

Hi all,

I have sequence throwing the error message: “ColumnName and ColumnName have conflicting properties: DataType property mismatch” while merging two datatables. The thing is, the column where it fails, it was created by me with a concrete DataType (string). Please see the details below:

First I read one Excel sheet:

Then I read the other (which has almost the same columns as the previous one).

Finally I add a new Column to both datatables indicating that the Type must be String

I print the DataTypes of both datatables

image

And I get the following:

image

My question is… why the column ‘Plant Name’ from DataTable1 and ‘Plant Name’ from DataTable2 have different DataTypes if I personally added the column in both of them indicating ‘String’ as the DataType?

@Marina_Ballester
may we ask you to share similar screenshot related to adding datatcolumn for the io_dtMaterials Datatable. Thanks

Hi Peter,

I don’t directly add the column to io_dtMaterials, but io_dtMaterials is a consolidation of many dtMaterialSheet. The workflow is the following:

  1. I read an Excel sheet and store it in dtMaterialSheet
  2. I add 3 new columns (Plant Name, Product Name and Sheet Name) to dtMaterialSheet, all of them of Type String.
  3. I merge dtMaterialSheet with io_dtMaterials
  4. Write io_dtMaterials in a new Consolidation Excel at the end of the process.

  1. Next time I execute the process, the robot reads the Consolidation Excel from last time, stores the data in io_dtMaterials and starts the loop again. (Read an Excel Sheet, store data in dtMaterialSheet, merge to io_dtMaterials, consolidate, etc.)

For that reason, io_Materials is a DataTable extracted from a consolidation of all previous read sheets to which new columns have been added. Therefore, I understand that the DataType of the consolidation Excel should be exactly the same as all the individual read sheets. But it isn’t…

@Marina_Ballester
thanks for your input. Lets keep in mind when read in data with read range the detected / used datatype can flicker driven by some values (e.g. string string string, vs. striong, int, date)

So lets find out what is happening - do debuggin the flow

after readin the Excel (dtMaterialSheet), adding additional columns it is merged with io_dtMaterials (so far we did understood)

But on the first merge how is io_dtMaterials initialized? Was it a clone or assignment from first MaterialSheet, (where nothing was to merge)?. Maybe do some debug checks on this.

However, to progress give a try on following:

  • use Object as Column DataType for e.g Plant Name Column
  • Or let control io_MaterialSheet the Plant Name Column Datatype dynamicly after adding as String datatype:

dtMaterialSheet.Columns(“Plant Name”).DataType = io_dtMaterialSheet.Columns(“Plant Name”).DataType

Find Playground XAML here:
DataColumn_SyncDataType.xaml (5.8 KB)

And

DataColumn_SyncDataType_PlayGame2.xaml (7.0 KB)

3 Likes