Hi.
I am not able to filter the data in excel by date column. I have multiple columns, one of them contains different dates. I need the data be filtered to show only a specific date, but my workflow doesn’t do that, meanwhile I’m not even getting any errors. Any advice will be much appreciated.
HI,
Can you share input sample and expected output?
Also share current your workflow and/or settings of activity etc?
Regards,
Hi @fnz007
Fallow the steps below. If I helped you, please mark it as solved.
To filter by a date column in UiPath, follow these steps:
Step 1
Use “Excel Application Scope” to open the Excel file.
Step 2
Use “Read Range” to read the table with the columns (including the dates).
Step 3
Use “Filter Data Table”:
Select the date column.
In the “Value” field, enter the date you want to filter by (in DateTime format, for example, DateTime.Parse(“2024-10-23”)).
Step 4
Use “Write Range” to save the filtered data if necessary.
Hello @fnz007
Please find the attached file. In this UiPath workflow, I have read an Excel file containing two columns: “Name” and “DOB.” The “DOB” column is a date field, and I have filtered the resulting table to keep rows where the “DOB” is greater than a specified date. I then wrote the filtered results to another Excel file.
The important peice of code there is the linq expression in an assign. this helps yoou filter dates:
dt.AsEnumerable.Where(Function(x) DateTime.ParseExact(x("Dob").ToString(),"MM/dd/yyyy HH:mm:ss",Nothing,Nothing) >= dateCutOff).CopyToDataTable()
SampleFilterByDates.xaml (8.2 KB)
Test.xlsx (8.7 KB)
Thank you
Happy Automation
Hi @fnz007 ,
Use this filter data table activity,
Click on configure filter
Add input DT and Filtered DT, take required fields.
I can’t pass the firewall to upload a file here. but imagine an excel sheet with employees’ name in column A (John, Mary, Jason, Hanna, Tom), and in column B, we have different due dates for each person.
For John and Hanna 6/30/2024, and for Jason, Mary, and Tom 10/30/2024) I want to filter the Due date to only show those who have due dates of 6/30/2024.
I hope this explains the file, and what I need to do with it.
And I should mention that they are not in a table.