How to use File Exists for Dynamic File in Studiox


I know a similar issue has been asked before: How to use File Exists for Dynamic File?

But i am not able to replicate the solution as i am using studioX.

I have a file which gets downloaded in the downloads folder by default and i need to check if file exists or not.

FileName as : “File_A 11111.xlsx” , this value “File_A” is constant and follows random number.

How can i use File Exists using wild card?

Thanks in advance.


Pass this


in the file


Hi Shiva,

Thank you for the prompt reply. I have tried but it didn’t work.

I have done what you have advised:

Not sure why it doesn’t work

1 Like

Well file exists activity doesn’t accept wildcard as a part of expression

Instead you can try with if condition like this

System.IO.Directory.GetFiles(“Download path”,“File_A*.xlsx”).Any()

Hope this helps

Cheers @josiahgoh276

Hi @josiahgoh276

Try with this expression



how do i add a condition to delete the file found if it exists? :open_mouth:

Hi @josiahgoh276

Try like this

Hope this helps!!


for delete you can use Delete file activity

place it in then block


Hi, i try to combine the delete file activity and the if condition stated above, it didn’t work:

Hi @josiahgoh276

Have you tried this

Hi, it didn’t work for me:

The file still stays there:



can you try by this way,its working fine for me


this is working for me. Thanks!

1 Like

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