UiPath - Removing duplicates from datatable & arranging with latest data
Core Logic
//Selecting Rows by Adding new Comparer Column - Concatenation of columns with which we need to find duplicates
dt_Input.AsEnumerable.Select(Function(row) _
dt_Temp.Rows.Add(row.ItemArray.Concat(
New Object() { String.Concat(row("First Name").ToString.Trim, row("Last Name").ToString.Trim, row("Facility").ToString.Trim, row("Claim Number").ToString.Trim) }
).ToArray)
//Grouping the rows by common Comparer & then taking the latest using order by
).GroupBy(Function(row) row("Comparer").ToString).Select(Function(grp) dt_Temp.Rows.Add(grp.OrderBy(Function(obj) obj("TimeStamp").ToString).Last().ItemArray)).CopyToDataTable