Filter Excel/Datatable doesn't work

Hello everyone,

i have the Excel with following values:


I want to get all rows with Laytime >= 100. That would be Ben, Jeff and Jenny. What I did was to Read the Range of the Excel to convert it in a datatable. Then I used the acitvity Filter Datatable with the following values:
Column: “Laytime”
Operation: >=
Value: “100”
but when i used that I don’t get anything. I get a empty Excel file.

Can someone please help me and tell me where my error is?

Thanks.

1 Like

Hi

welcome to uipath community

Filter datatable will work on filter with numerical values
but when we read from excel it would be of type string for all the columns

–so unless we change the datacolumn with int32 type we wont be able to do it with filter datatable activity

but still we can try with select method like this
dt.Select("[yourcolumnname] >= ‘100’ ").CopyToDatatable()

this would work for sure

Kindly try this and let know for any queries or clarification
Cheers @cathschaen

Thanks for your reply @Palaniyappan .

I am not sure which activity you mean? Do you mean some select (item or multiple item)? Where should I type dt.Select("[yourcolumnname] >= ‘100’ ").CopyToDatatable()?

Fine
in assign activity
in the left side mention this dt
where dt is a variable obtained as a output from read range activity which is a variable of type datatable
then in the right side of assign activity mention this
dt.Select("[yourcolumnname] >= ‘100’ ").CopyToDatatable()

but before doing this close your xaml and open the xaml in notepad by right clicking on it
there mention this. Only then we can mention the copytodatatble method along the assign activity
image

here you go with the xaml
hope this would helpyou
filter.zip (16.8 KB)

Cheers @cathschaen

It worked, thank you @Palaniyappan :slight_smile:

1 Like

Cheers @cathschaen

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