Can file identify its folder path?

How can different excel files can identify from which folder they are coming? I have 10 folder and using for every folder “Flow Decision” with “UCASE(item.ToString).StartsWith(UCASE(“FolderPath”).ToString)”.
Is there any better way i can use switch with a expression? or any better suggestions?


Hi @bullah,

Welcome to UiPath Forum Community. Can you please elaborate your situation with example to get a right solution.


1 Like


you can use Path.getDirectory to get the directory path.
refer this

1 Like


folderPath = Path.GetDirectoryName(filePath)

This will return you folder path for file

1 Like

First of all thanks for welcome and all replies… I elaborate more with pic
I have 10 different folders and getting all files in a List(in GetTransaction).
Each folder has a country name and then “For Each loop” files from List<> should go to that country or folder (in) and process further. I have made a Flow decision and its working but with 10 decisions. Is there any smarter way i can achieve it better? or might be with Switch?

I think this will return only folder path but cannot recognize file according to it? i am new so please share your knowledge with me

Thanks for your reply. i am using that already to get files from folder and then all files go to a List but want to have a better logic… please see the image below and that will help you to give me better solution. Thanks

Thanks for welcome and please the image and explantion below

Try parallel activity, if you have 10 condition in any way you have to have 10 if or flow decision activity.

But instead of having 10 flow like you flow we can use ternary operators.

Share your code and ill make changes and update.

Thanks @Ragu9060 its great but i have never used Parallel activity.
UCASE(file.ToString).StartsWith(UCASE(in_Config(“HU_FolderPath_Start”).ToString)) Folder file.xaml (50.9 KB)
it is a sample file and if you Need further any informaiton please ask and please share more because i want to learn …

ucase is the expresssion i am writing in flow decision. i forgot to mention