Not able to find file in folder

Hi Team,

I have one automation where bot will download file from one application and will be stored in particular location.
File name is also created by bot. By using file name I am trying to search file in folder. My issue is even though file is present bot is not able to find file.
I am using below formula’s(neither of them is working) -

1 - Directory.GetFiles(in_Config(“COL_CTRIPM_EPP_ExtractFileRoot”).ToString,strTCID+““+environment.UserName+””+Today.ToString(“yyyyMMdd”)+“_*_EPP_OK.xlsx”,SearchOption.AllDirectories).OrderByDescending(Function(d) New FileInfo(d).CreationTime)

2 - new DirectoryInfo(in_Config(“COL_CTRIPM_EPP_ExtractFileRoot”).ToString)
idirectory.GetFiles(strTCID+““+environment.UserName+”__EPP_OK.xlsx”).Where(function(file) file.LastWriteTime.Date= DateTime.Now.Date).OrderByDescending(function(d) d.LastWriteTimeUtc).ToArray

Could you please suggest any solution

Hello @Kola_Mounika

Welcome to UiPath community…!

Can you please print the file name in a message box and validate it once.

Also print the config root folder value as well.

Another approach enter a hardcorded path and filename and see the approach is working as expected. If yes, there is some issue with the values from the config and the full file name used in the Directory.GetFiles


HI @Kola_Mounika

Have you used your system name in your file name?