Check file exists or does not in these folders

Hi Everyone!

I have a problem that I would like anyone to give me some suggestion

I need to check file exists or does not in these folders but the inside of these folders have any subfolders

Now, I use the file exists activity but I don’t know how to input File path because it need to input the specified file path

Sorry for my English
Thank you so much in advance.

HI @Nattawadee_Srisai

Checkout this expression in if

System.IO.File.Exists(Directory.GetFiles("Your path","filename.extention",SearchOption.AllDirectories)(0))

Regards
Sudharsan

we can do:
arrFiles | String Array

arrFiles  = Directory.GetFiles(MyDirPathVar,"*.*",SearchOption.AllDirectories)
arrFiles  = Directory.GetFiles(MyDirPathVar,"myFileNamePlusExtension",SearchOption.AllDirectories)

For the existence check we use: arrFiles.Any()
Also have a look here:
[CheatSheet] - Filesystem APIs - News / Tutorials - UiPath Community Forum

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.