How to create sub-folders with increment in today's dated folder

I want to create Sub-Folder into my main folder which is created with today’s date.
I want to create this folders with increment. Like Run1…Run2…Run3 after every transaction done.

In below image I have created today’s dated folder for first transaction, but for next transaction I want to check whether today’s dated folder exists or not, if exist create sub-folder into that else create today’s dated folder and then create sub-folder into that.

image

I want to create sub-folder same like below.
image

To Achive this I have use below activity and with the help of this I am able to create folder till Run1.

image

Below code I have used for create Folder
image

image

Now only remaining task is to check folder exist if not create it with increment.

@nilesh.mahajan Can you provide the xaml File, I think you are very Close to Achieve what you need :sweat_smile: . Try Retrieving the Last Created folder inside the Current Date Folder i.e. Run[Number], Then when you get the Folder Name, Get the Number from the Folder and increment it by 1. and Assign it to the Create Folder Activity. In this way, The Folder gets Created each time for Different runs.

Hi @nilesh.mahajan,

Can you try this? I have created it as a sequence, you can change it to flowchart if required.

Main.xaml (7.2 KB)

2 Likes

Hello, Thnx for reply,

I have used the activity as per you suggest, but now observe that after creating 11th folder BOT created 22nd folder.

image

I have use below code.
image

image
image

Hi @nilesh.mahajan,

Sorry my mistake. :slight_smile:

Please change the name value as
“Run”+(Convert.ToInt32(System.Text.RegularExpressions.Regex.Match(name,"\d+").Value)+1).ToString

2 Likes

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