You could sort the collection on the date, read the collection in a loop and check each row for the creation date to see if it needs processing or not. It is after all only 14 rows. That'll save you filtering the collection.
In order to tackle a issues with syntax such as in a Filter action, start simple by using only one date to select on and then work your way up to multiple dates when this works.
To keep thing readable, use a Data item (eg. [Filter], Text) that you build up in a MultiCalc stage and use in your Filter action. First you calculate Date1, then Date2 and then you build the Filter. That way you can easily see if you missed a quote or bracket in your calculations.
This:
FormatDateTime(Today()&" "&LocalTime(),"dd/MM/yyyy")
Delivers this:
30/11/2020Note there's no time!
This:
FormatDateTime(Today(),"dd/MM/yyyy") &" "&LocalTime()Delivers this:
30/11/2020 11:45Which might be what you're looking for. This:
FormatDateTime(Today()&" "&LocalTime(),"dd/MM/yyyy hh:mm") does the same.
Don't forget to let us know how it went!
------------------------------
Happy coding!
Paul
Sweden
------------------------------
Original Message:
Sent: 11-27-2020 04:00
From: Digital Worker Blue Prism
Subject: Is there a way to filter a folder by dates Blue Prism
I am having issues around [Utility - Collection Manipulation - Filter Collection]I have a Get Files action which gets all the files from a particular folder and outputs them into a collection in Blue Prism (there are 14 .txt files)I then use the Filter Collection Object to filter this folder "Files"I am trying to only bring back results in the collection for where the "Created" (DateTime) = today or yesterdays date.
Date1( DateTime) FormatDateTime(Today()&" "&LocalTime(),"dd/MM/yyyy")Date2(DateTime) FormatDateTime(DateAdd("9", "-2", Today())&" "&LocalTime(),"dd/MM/yyyy")
Filter Expression : "[Created] <= "&"'" &[Date1]&"' and [Created] >= "&"'" &[Date2]&"'"
There is no Error message and it doesn't output any results.I am thinking that maybe Date1 and Date2 aren't being read as dates perhaps?
Any help on this matter would be greatly appreciated.
Regards,
Gary
--------------------------------------------------
Disclaimer: This content was auto-posted from Stackoverflow. The original Stackoverflow question is here Stackoverflow Post, posted by Gary.