Generate an ID using counter

Hi,

I want to generate an ID for my folder by using counter. The ID will start from number 001 and keep increasing if the number of folder increase. Example, if I create a folder inside my project folder, the robot will rename the folder that I created as 001 and if I add another folder the robot will keep rename the new folder that been added as 002, 003, 004 and so on. Is it possible to make it?

@Aoyama Can you please specify how you are going to create a folder inside your project folder that is by manually or by bot.

Hi @indra,

Thanks for your fast reply. The folder will be create automatically by the robot as the robot create the folder, it will rename that folder with the ID such as 001, 002, 003… What I want to do is the robot will rename every folder that being created or the new folder with number start from 001 and keep going on.

@Aoyama Suppose if the robot creates folder 005 and stops and when it run for next time folder name should starts from 006 right

@indra Yes and it will continue on.

Hi @Aoyama

Please try this.
You can input your folder name, and robot will add counter to it and create the folder in “Result” folder.
CreateFolder.zip (10.6 KB)

(Directory.GetDirectories(“C:”).Count + 1).ToString(“000”) this will give your next folder name… Change the folder path before using it

Hi @Aoyama

New Studio was created for your request.
Please try it.
CreateFolder_New.zip (11.1 KB)

@Toby, thanks for the workflow. I will try it.

Thanks for your reply @sarathi125.

It works for the same name but for different name it will count as the first folder which 001. Btw, thanks for the workflow.

Hi @Aoyama

Got your point.
You can change 'Directory.GetDirectories(“Result”,str_folder_prefix+"*")'to 'Directory.GetDirectories(“Result”) '.
And then it will work for different name too.

It works! Thanks.

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