Datatable, Enumerable error

Hello forum,

Problem:
I am a beginner in UiPath and I want to join 2 datatables as shown in screenshot based on 2 matching columns, and then pick the columns that I need from table1 and table2 and save it to a IEnumerable variable matchedRows.
I then want to append the result(matchedRows) to an existing table 3 which has the same columns as table 1.

My approach:
I tried converting tables to Enumerables and then use join to accomplish this but I am getting errors like :
the type ‘ixmlserializable’ is defined in an assembly that is not referenced

What would be the best way to update datatable3 with new rows based on above criteria? Any alternatives or fixes to my current approach?

Please feel free to change the subject line as I wasn’t sure what would be the best way to describe this post!

Hi @Parth_Sharma

Pls check this,

OR

Happy Automation

(From data1 In Dt1.AsEnumerable()
Join data2 In Dt2.AsEnumerable()
On data1(“XX no”) Equals data2(“XX no”)
Select DtClone.Rows.Add({
data2(“XX no”),data1(“Name”),data2(“Status”),data2(“Comment”),data2(“Date”)})).copytodatatable()

@Parth_Sharma

Easier way would be to use a join datatable activity first and then a filter datatable activity to get only columns you need from the joined table

Then use merge datatable to merge the joined data to table3 as needed..one thing you need to remember is after getting only columns you need the column names should match with table 3 to merge properly else you can rename the columns as you need and then merge

So 3 steps

  1. Join dattable activity table 1 and 2
  2. Filter datatable for joined table and get only columns you need
  3. Merge datatable for appending joined datatable to table3

Cheers

Is there a particular reason you want to keep the data as IEnumerable?

If you can use the data as a datatable itself, You can use “Join DataTable” activity to join table 1 and table 2, then use “Filter DataTable” activity to keep only particular columns.

Finally use “Merge Datatable” activity to add the result to table 3 or even “for each row” loop and the use “Add data row” activity to add the new rows.