Removing rows from datatable

I have a datatable below that i receive from an API call, the section of this datatable is field From and To. I want to remove the rows where the From and To are the same.

E.g. PRIMARY.personalDetails.forename,Heldmann,heldmann - From: Heldmann and To: heldmann are the same it’s just case different i’d like to remove this and any other row that may have the same values

[Field,From,To
personalDetails.title,DR,MR
PRIMARY.personalDetails.forename,Heldmann,heldmann
PRIMARY.personalDetails.middleName,K,A
PRIMARY.personalDetails.surname,Penisten,Smith
]

Hi @duaine.b
→ Build Data Table
Output= YourDataTable


→ Use the below syntax in Assign activity:

distinctRows= (From row In YourDataTable.AsEnumerable()
               Where Not String.Equals(row.Field(Of String)("From"), row.Field(Of String)("To"), StringComparison.OrdinalIgnoreCase)
               Select row).CopyToDataTable()

distinctRows is of DataType System.Data.DataTable
Output:


Workflow:

Regards

Hello @duaine.b - There are two ways to achieve this -

  1. Using Filter Data table activity
  2. Using Datatable.Enum function

please find attached dummy workflow, I haven’t tested it but may need some modifications.
Main-2.xaml (12.2 KB)
Test.xlsx (9.4 KB)

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