Filter multiple column using Linq

I am trying to create filter two columns column 1 and column 2 using Linq. but my column 2 is not getting filterd.Attached below the sample file for reference. can anyone help on it
Book1.xlsx (63.4 KB)

OutDT.AsEnumerable().Where(Function(row) (row.Field(Of String)(“Part Type”).Contains(“System Pipe Fittings”) Or row.Field(Of String)(“Part Type”).Contains(“Pipe Fittings”) Or row.Field(Of String)(“Part Type”).Contains(“Pipe Accessories”)) AND row.Field(Of String)(“Revit System Status”).Contains(“Completed”)).CopyToDataTable()
Main.xaml (8.5 KB)

Hey @vignesh.maruthappan

Use this LinQ:

OutDT.AsEnumerable().Where(Function(row) (row.Field(Of String)(“Part Type”).Contains(“System Pipe Fittings”) Or row.Field(Of String)(“Part Type”).Contains(“Pipe Fittings”) Or row.Field(Of String)(“Part Type”).Contains(“Pipe Accessories”)) And (row.Field(Of String)(“Revit System Status”).Trim.Equals(“Completed”))).CopyToDataTable()

Or just remove Contains at last & put .Trim.Equals in your above linQ

Cheers!
Ajay Mishra

@vignesh.maruthappan

I’m attaching your .xaml for your reference!
Main.xaml (8.5 KB)

Use this surely you will get the output.

Happy Automation!

Regards,
Ajay Mishra

that’s great.thanks.its working. Sorry for late response

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