How to select files with a specific name (thats taken from an excel table?)

Hi there,

First time poster, I have an excel table with multiple rows of names (lets say A, B, C) id like to select all files in a different folder with a name (from row 1 for example) A and then repeat with the name B, and then C, anybody who could help me out?


welcome to the forum

have a look at the filter options
Four Ways to Filter Data Tables in UiPath Studio | UiPath

could be a case of grouping the data on name

Hi, thanks for the quick reply, i think i didnt express myself clearly, the excel table holds only the names, i need to select all files in a different folder, with the name provided from the excel table.


Welcome to the community

Please use a for each row in datatable activity

And then use directory.Getfiles(“folderpath”,““+currentrow(“columnnamecontaining name”).ToString +””)

This will give an array of all the matching names from given folder



If you need, for example, to send out those files, you could also make for each row loop,
use Send Email and in the Attachments use: String.Format(“C:\yourdirectory\filefolder{0}.*”,CurrentRow.ByIndex(CollumIndex) Just accomodate the * wildcard in your file name in case file contains more than just the name from your collumn and unless the files are of same type, like pdf etc. use a wild card for extension.
I am using such case so hopefully it could work on your side.


Hi, thank you very much for the help, do you perhaps have a screenshot? Or which activity should I use for the use directory.Getfiles?


Create a array of string variable

Use assign activity and on left give the array and on right use directory.getfiles

Hope this helps


Hi, thanks for the info! I need to select files with the same name as specified in the excel, and then drag and drop them into an application window, then repeat with the next row.

Anil advised how to get array of your files. then you need just to make a loop for each row and use click activity, just like explained here:


If you have an option to give the path it would be easy and reliable to use that…than drag and drop

In the expression provided above the second part filters the files with the provided name


Hi @Le_Long1 ,

Please follow the steps given in the below screenshot to achieve your requirement.
Let me know if you need any further clarification on the same.

outer for loop is to iterate through excel-dt rows and inner for loop is used to iterate through files in folder.

Ashutosh Gupta

Unfortunately no option for path, it has to be dragged and dropped