PathExist with wild card


I have this forloop looping a list of numbers
and the files contain a number + some random string + .xlsx


doesn’t work. item is the number

Thanks in advance


Hi @lavint… Try item.tostring in the path details


Sorry, what I mean it doesn’t work is that the wild card * doesn’t work.
it will print as 11111*.xlsx instead of being a wild card. Any idea how to fix it?

Hi @lavint ,

Can you check if you can pass the random string to some variable and then pass to path. Let me know if it works.


what is random string? wild card?

" number + some random string + .xlsx "

I meant, if you are not aware of the random string, get the string value in a variable and provide the variable in the path.

Hi Lavina,

Path Exists activity will check for the exact path or file if exists or not, it does not support wildcards.

For your project, you can use the .Net method GetFiles from System.IO.Directory type. This methods returns a list of string with all files names inside a directory and you can specify a filter using wildcards.



Hi @Silviu,

Thanks for your response. I am aware of directory.getfiles. The issue is that there are for example 1000 files in the directory - I only need certain files and some files that I need may not exist, so I was thinking if it was possible to use the string array that I have to check if the path exists first, then get file. And the file path consists a variable string and whatever follows(wild card) + .xlsx. Anyways thanks for the confirmation.

Warm regards,


The problem is I need wild card. Thanks for trying though.

Warm regards,

1 Like

Hi @lavint,

Please check this


Hi @lavint, have you solved this out?

Just solved out, if need help, refer here: Wildcard file path