I have this requirement:
- Need to filter for all rows where status <> red
- The last login date < today’s date
I need to use this data for further processing. Which is the best way?
If you have any sample workflow please could you share?
I have this requirement:
Forgot to attach the sample excel file. How do I do it? But below is the sample:
|First Name||Last Name||Status||Last Login Date|
As it is structured data use Data scraping Activity to read the data and will give you output as dataTable and say ‘DT’. And then try below expression to filter it.
filteredDT = DT.Select("Status <> 'Red' AND [Last Login Date] < 'Now.Tostring("MMM-dd-yyyy")'").CopyToDataTable
And other way is to use Filter dataTable Activity to do this.
Thanks for your clarification. Do you have a sample workflow you can share with Filter Data activity particularly with date filters?
I am getting runtime error. Filter table: The range does not exist. Please help.
Could you please show me screenshot of Filter dataTable Activity once and need to check once how you passed it.
Uipath version 19.7.0 in select method i got error…copy to datatable is not a member of system in array…
Welcome to the UIpath Community.
It’s looks like Status column showing values as 0 and it’s wrong. Could you please reset the ACME data and then try once.
You can use below expression to filter data.
filterDT = yourDT.Select(“WIID > ‘200000’ AND DESCRIPTION = ‘REASEARCH CLIENT SECURITY CHECK’ AND TYPE = ‘WI2’”).Toarray.CopyToDataTable
Filterdata, what kind of variable?after.ToArray it is not coming. Copy to datatable??
Here, filterDT and yourDT both are variable of type DataTable.
I have a date column in my excel data table. I have to filter out based on dates less than today. How do I do it? Could someone help me with the logic.
we can mention like
yourdatatablename = yourdatatablename.Select("[youcolumnname] < ’ # Now.ToString(yourdateformat) # ’ ").CopyToDatatable()
where yourdateformat means the dateformat of the value from the date column in your excel
we can check that with a simple write line activity like
which will give us the value of date in output panel from where we would know the format and mention the same date format there in the above Now.ToString(yourdateformat)
yourdatatablename = yourdatatablename.Select("[youcolumnname] < # " + Now.ToString(yourdateformat) + " # ").CopyToDatatable()
in the above query
I tried with the logic you provided above. My filter bot runs and it does not do anything. Do you have a sample workflow, so I can compare it?
hope this could help you
it has similar syntax
kindly try this and let know for any queries or clarification
did that work buddy @Vidya_Lingappa
Hi @Palaniyappan ,
which example are you referring to? Sorry I did not understand. Please let me know.
Good luck getting the FilterDataTable to work