I had 2 datatable. I want to check data from table1 and verify in table2 if exits or not

I had 2 datatable. I want to check data from table1 and verify in table2 if exits or not. If data not exits i want to add that data in table2 and if exits then i dont want to add that data.

Like if 1234 does not exits in table2 then i will add this to table2 and if 1234 exits in table2 then i dont want to add that.

Hope the below steps would help you resolve this

  1. First let’s get the unmatched records between two tables like this using an Assign activity

Out_NonMatched_Data = In_DataTable1.AsEnumerable().Where(function(row) Not In_DataTable2.AsEnumerable().Select(function(r) r.Field(Of Int32)(In_DT2_ColName_To_Match.ToString)).Any(function(x) x = row.Field(Of Int32)(In_DT1_ColName_To_Match.ToString))).CopyToDataTable()

  1. Then use a Merge datatable activity and merge th me found unmatched records and datatable 2 as u want where mention the source datatable as above found one and destination as datatable 2

Cheers @Puneet_Singh1

Hi @Puneet_Singh1

Try with these steps:

  1. Read Range (Table1) → DataTable1
  2. Read Range (Table2) → DataTable2
  3. For Each Row (DataTable1)
    • Assign → dataExists = False
    • For Each Row (DataTable2)
      • If (row(“Column1”).ToString() = CurrentRow(“Column1”).ToString())
        • Assign → dataExists = True
        • Break For Each
    • If (dataExists = False)
      • Add Data Row (CurrentRow) → DataTable2
  4. Write Range (Table2) → Update the existing Table2

Getting this.

looks like you arrayrow has more then 15/16 items
we can handle by

new Object(){item1,item2......item15}.Concat(new Object(){item16........}).toArray()

Still getting error.

can you try half in the first array, the other half in the second array?

Feel free to share your XAML with us

[quote=“ppr, post:5, topic:577880”]
new Object(){item1,item2......item15}.Concat(new Object(){item16........}).toArray()


new Object(){Action,dailyWorkReportName,workOrder,jobCategory,pearceJob,location,dwrStatus,submittedDateTime,jobStopDate}.Concat(new Object(){workOrderStatusGroup,jobStatus,Technician,technicianManager,createdDate,state,Account,countDWR}).toArray()

Hello is there any solution if we have more than 16 items to add

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