Creating Folders using Folder Exists

Hello…

I need quick help here, currently, I am working on automation where I need to create 3 folders in a Parent folder.

I tried putting the following expression:-

“path.Combine(in_folderpath,in_foldername+”/“+“Input_File”+”/“+“Image_JPEG”+”/“+“QR_Code”)”

but its creates a folder inside a folder and the expected output is

Input_File
Image_JPEG
QR_Codes

Or if there’s any other way that will be a great help.

We Would assume, that the confusion comes from:


the slashes and the concatenated folder names

When e.g.is needed

C:\_rpa\Input_File
C:\_rpa\Image_JPEG
C:\_rpa\Image_JPEG

we can do:

Variable: strRootFolderPath = "C:\_rpa"

grafik

item in new String(){"Input_File","Image_JPEG","QR_Codes"}

2 Likes

in addition to above:

so we omitted the existence check

Hi @Anirudh_Tugawe

Use the below syntaxes in Assign activities:

sharedLocation= "C:\"
folder= path.Combine(sharedLocation,"2024")
InputFolder= Path.Combine(folder,"Input_File")
ImageFolder= Path.Combine(folder,"Image_JPEG")
QRFolder= Path.Combine(folder,"QR_Code")

All the variables are of DataType System.String. Make sure to change the path in sharedLocation variable and folder names according to yours.
→ After the Multiple Assign I have used Folder Exists and If. If the folder is already present, it won’t create a new folder. Same in case of all folders.
Workflow:


xaml:
Sequence19.xaml (17.6 KB)
Output:

Regards

Thank you so much, you saved my time

God bless you.

Perfect. so the topic can be closed
Forum FAQ - How to mark a post as a solution - News / Tutorials - UiPath Community Forum

Thank You i will try this method too.

1 Like

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