How to Filter Data Table

Cool, you can replace “A(.)-(.)B” with something like the below
“Bread(.)-(.)butter”
or to ignore case:
“[bB][rR][eE][aA][dD](.)-(.)[bB][uU][tT][tT][eE][rR]”

Thank you…

Just wanted to ask. The Filter Data Table is not available in my activities. But the UiPath.Core.Activities package is installed properly. The available activities for me only under the data table is Build, Clear, Generate, Merge and Output.

Thank you for answering.

Hey @ClaytonM

I applied below syntax for filter data table , But getting error , Please let me know any another alternate please

Image5

Hi.

where you have vMainDT.Select(), change that to vMainDT.AsEnumerable
Although, I’m not sure it will make a difference.

If the column does not exist, then make sure that vMainDT has the column (you can check it with Output Data Table activity then show the string in a Message Box or Write Line). Keep in mind, if the file does not exist, the Excel Scope will create an empty Excel file with no column names.

Other than that, your syntax looks good.

You can try using lambda expression, which is basically the same thing.
That would look like this:

vMainDT.AsEnumerable.Where(Function(row) row("Division").ToString.Trim.Equals("07") ).CopyToDataTable

Regards.

Got it,

In read range activity I for to check the Headers option

1 Like

Hello All, I’m trying to filter an excel sheet with three columns and then Im writing to another excel sheet.
But filtered data is not getting written into new excel sheet. I’m attaching .XAML file, please suggest.ExcelPractice2.xaml (16.6 KB)

Hi @nikhil_rao,

In write range click add headers & try once
no need of using for each row,directly you can give filter data table output in write range

Some minor edits:
dt2 = (From row In dt1.AsEnumerable() Where row("ColumnName").ToString.Equals("") Select row).CopyToDataTable()

Hi Dear,
You can use Activity Filter Data Table

image

Thanks!

2 Likes