File management is inevitable in business processes automations.
We might want to copy, move or delete files based on few conditions…!!!
Let’s see how to get the specific type of files from a folder 🙂
_myList = Directory.GetFiles(_folderPath,”*.zip”,System.IO.SearchOption.AllDirectories)
1. _folderPath is the folder path where you have your files
2._myList is the variable containing your required files
3.Replace “*.zip” with your desired extension.
Implementation using UiPath :
Let us implement a workflow which displays the names of particular files(.i.e .zip extension files) from a folder.
Drag “Assign” activity into the design panel and populate it with your folder path
Drag “Assign” activity into the design panel and populate it with above-mentioned code
Drag “For Each” activity into the design panel and pass the above “filesList” variable to it.
Drag “Message Box” activity into the For Each activity and pass the “item” value into it.
when we run it, we can see the file names of .zip extension being displayed.
Click here to download the Source Code…
Hope it has helped you…
2 thoughts on “How To Get Specific Type Of Files From A Folder – In UiPath”
Hi Sharath bro,
Thanks for the good article.
When we needed multiple files like (.png and .pdf) what might be the code
is this valid?
Hey GangaReddy, Thanks
Try this 🙂