Merge Data Table Data Exception

Hello everyone,

I am trying to merge two data table. DtOne is being read from an .xlsx file and DtTwo is being read from .csv file. Both has similar column number and name. I get the below error.

image

1 Like

Hey @Saminur_Miah

There is some column data type mismatch like may be in one sheet it is of type number & on the other as string for example.

So kindly check that part once please.

Thanks
#nK

we do see the col names but not the corresponding datatypes of the data column

Hey @Saminur_Miah

Not the data type of the data tables, but the columns present inside it.

You need first unify it & then proceed for merge.

Thanks
#nK

1 Like

just set a breakpoint on the merge datatable activity, debug and get paused
use the immediate panel and check with following statements:

dtOne.Columns("Account").DataType
dtTWo.Columns("Account").DataType

Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

1 Like

image
This might be the issue

Yes it is.

Have you a chance to harmonize it? From where/which source is dtOne from?

DtOne is from .xlsx file. DtTwo is from .csv, then, it’s filtered by Account and Output to DtTwo

We don’t know all your details. The following fix strategies can be checked:

  • format cell to a consistent type triggering the string datatype while read range - e.g. Balareva Package, Uipath …

  • dtOne: Add Helper Data column with harmonized datatype (String), update the helper col with converted value, remove Account column, set helper column to the origin position with the help of SetOrdinal method, rename the helper data column to Account

  • Merge with a LINQ - when data column structure is similar

  • Merge by for each row , add data row | dtTWo.Row - ItemArray - - when data column structure is similar (technically possible, but not a preferred choice)

  • just append range (using dtTwo) on dtOne Excel

1 Like

Thank you!

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