Hi All, I am looping two data tables, In second data table i am using if condition my issue is i want to pass if condition data by using argument

Hi All, I am looping two data tables, In second data table I am using if condition my issue is i want to pass if condition data by using argument CURRENTROW1(“A”).ToString.Equals(CurrentRow2(“A”).ToString) And
CURRENTROW1(“B”).ToString.Equals(CURRENTROW2(“B”).ToString)

Note-I want to pass entire data via args not columns names

Hi @Shivam_Badgaiyan,

Let’s assume your two DataTables are dt1 and dt2, you can retrieve the rows of the second DataTable along with the filter using this LINQ statement:

dt2.AsEnumerable.Select(Function(CurrentRow2) dt1.AsEnumerable.Where(Function(CurrentRow1) CurrentRow1("A").ToString.Equals(CurrentRow2("A").ToString) And CurrentRow1("B").ToString.Equals(CurrentRow2("B").ToString)))

Cheers

Hi @Shivam_Badgaiyan

  • For Each Row in DataTable1 (Output: CurrentRow1)
    • For Each Row in DataTable2 (Output: CurrentRow2)
      • If: in_CurrentRow1(“A”).ToString.Equals(in_CurrentRow2(“A”).ToString) AndAlso in_CurrentRow1(“B”).ToString.Equals(in_CurrentRow2(“B”).ToString)

        • Invoke Workflow File (“ChildWorkflow.xaml”)
          • Import Arguments
            • in_CurrentRow1: CurrentRow1
            • in_CurrentRow2: CurrentRow2