Filter a file by name not working!

I’ve just built a simple UiPath automation that involves accessing a website, clicking on a UI element to trigger the download of an Excel file, waiting for the download to complete, and then apply the For each file in the Downloads folder. After successfully downloading the file, I intend to perform further tasks with the data within it. However, I’ve encountered a problem during the final step of the process.

When I use the ‘Filter by’ option and apply a wildcard like ‘*.xlsx’, it works as expected and selects all Excel files within the folder, which is great. However, when I specify the exact file name, as shown in the screenshot, I don’t receive any errors, the automation completes the download of the file, but it doesn’t access the specified file, and it doesn’t proceed with the subsequent steps in the automation flow.

Any insights or suggestions on why this might be happening would be greatly appreciated!"

Hi @jabid.jimenez

Check out this thread. It might help you.

Hope it helps!!
Regards

1 Like

I saw that before but I cannot open the file, not sure why sorry, I get this error

Hi @jabid.jimenez

That is Studio compatible project you will be not able to open in Studio X… convert your Studio X to studio and see what are the activities performed in the same way you can perform that in studio X.

Hope you understand

Regards

HI @jabid.jimenez

In the Filter option we can give the extension of the file only. If filters the files with extension. In your case, you want xlsx files. In the filter option field you have to give like this *.xlsx.
Then you can get the only excel files.
Inside for each Insert an If condition to get the files with the Specific names.

Condition - CurrentFile.Names.Contains("incident")

In then block you will get only the name which contains incident files with xlsx entension.

Check the below workflow for better understanding.

Hope it helps!!

@jabid.jimenez

If you need a specific file then why do you want to use for each file in folder activity again…

Directly just use the path to file to get to the file

Path.Combine(userfolder,"Downloads","incident.xlsx")

Also the reason could be the filename is little different or it is not present in the given folder

Cheers