Help with if/then/else Logic using LINQ

(From d in YourDataTableVar.AsEnumerable
Let cs1 = new String(){"Date1","Date2","Date3"}
Let cs2 = new String(){"Thing1","Thing2","Thing3"}
Let dpc = cs1.Select(Function (x) DateTime.TryParse(d(x).toString.Trim, nothing)).toArray
Let tbc = cs2.Select(Function (y) CBool(d(y).toString.Trim)).toArray
Let chk = dpc.SequenceEqual(tbc)
Where chk
Select r = d).CopyToDataTable
  • cs1, cs2 could be externalized so it will not be done for each loop
  • the dpc, tbc constructions can be modified if needed e.g DateTimeParseExact…

Handling empty results we can do as described here:
:ambulance: :sos: [FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum