cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Delete Files stage

TushigbayarTsev
Level 3
Hello, 

I have an issue with Patterns for Delete Files stage in Utility - File Management
I need to delete files with multiple patterns. 

I wrote Patterns: "*.png, *.xlsx, *.isdoc" but it wont delete those files.
Why is that?

------------------------------
Tushigbayar Tseveenbayar
------------------------------
2 REPLIES 2

Hi Tushigbayar,

The reason is the VBO doesn't works that way with multiple patterns. If you see the code inside it, you will see Directory.GetFiles() method has been used which takes only one pattern. One easy way to solve it is, use a predefined calculation, let say 'Patterns' with all the patterns mentioned in column of text type, let name it as 'Extension' and in separate rows you define the patterns one by one. Then you use a loop stage to iterate within that collection and then use this action 'Delete Files' with the input argument for Pattern as [Patterns.Extension]

Let us know if that helps!

------------------------------
----------------------------------
Hope it helps you and if it resolves you query please mark it as the best answer so that others having the same problem can track the answer easily

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please provide a big thumbs up so that the others members in the community having similar problem statement can track the answer easily in future.

Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Technical Business Analyst,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com

----------------------------------

Hi @Tushigbayar Tseveenbayar

I change a little bit the "Utility - File Management" to implement an action to perform this.

In this Business Object, Utility - File Management Extended" you have a new method, "Delete Files Multiple Patterns".

The input parameters are the same as the "Delete Files" Action. But... in the patterns parameter you must to put all the patterns that you want separate with ;

i.e: "*.png;*.jpg"

Here is an example of how to use it:
774.png


Hope this helps you, and if this solves the problem, mark this message as the best answer 🙂

See you in the community!! Bye 🙂


------------------------------
Pablo Sarabia
Architect
Altamira Assets Management
Madrid
634726270
------------------------------