Check Folder exist in a Flow decision without the Folder Exists activity

Hello, i want to check if a Folder Exist and thats very clean in my Flow Chart, how can i do this with a formula in an flow decision?

I try this "File.Exist("C:\UiPath") but it doesnt work

HI @NHoe

Have you with this expression in Flow Decision

System.IO.File.exist("YourPath")

Regards
Gokul

1 Like

You can try with Path Exists activity to find a folder/File exists or not. The activity will return an boolean value.

Regards
Gokul

HI @NHoe

You can also try like this in you flow decision

Directory.GetFiles("Your folder Path","Filename.extension").Count>0

Regards
Sudharsan

Hi, thank you all for your reply
i try System.IO.File.exist(“YourPath”) and Directory.GetFiles(“C:\UiPath",”.dir").Count>0 but both doesnt work

What was the issue you are facing @NHoe ? Can you share some screenshot

Hi,

Please try this “Directory.Exists(“FolderPath”)” in the assign activity, you will get the boolean response, it works for me

Hi @NHoe Please try the path exist activity
image

Thank you, that works fine

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