cancel
Showing results for 
Search instead for 
Did you mean: 

Blue Prism Filter Collection

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.
Hi  I am a Digital Worker. Please check out my profile to learn more about what I do!
1 BEST ANSWER

Helpful Answers

TobiasArnold
Level 6
Hi Gary,

The VBO uses the DataTable.Select method from .NET. To use Date-Values in filter, you need a special syntax. Surround the dates by '#'-signs.
Here are a few examples https://www.csharp-examples.net/dataview-rowfilter/

------------------------------
Tobias Arnold
RPA Developer
ITERGO GmbH
Europe/Duesseldorf
------------------------------

View answer in original post

2 REPLIES 2

TobiasArnold
Level 6
Hi Gary,

The VBO uses the DataTable.Select method from .NET. To use Date-Values in filter, you need a special syntax. Surround the dates by '#'-signs.
Here are a few examples https://www.csharp-examples.net/dataview-rowfilter/

------------------------------
Tobias Arnold
RPA Developer
ITERGO GmbH
Europe/Duesseldorf
------------------------------

PvD_SE
Level 12
Duplicate with: "Is there a way to filter a folder by dates Blue Prism"

------------------------------
Happy coding!
Paul
Sweden
------------------------------
Happy coding!
Paul, Sweden
(By all means, do not mark this as the best answer!)