cancel
Showing results for 
Search instead for 
Did you mean: 

Creating new folder for a new month after saving as an excel sheet

SwatiAgrawal
Level 5
Hi All,

I am quite new to Blueprism and hence posting a query where I am stuck.
I have created a bot wherein an excel sheet will be "saved as" to the current path. But I want to cut, paste the excel sheet into a new folder of current month if the new month has started. For Eg: If the excel sheet was earlier getting saved in "August" folder and now since the new month September has started then I want the bot to recognize that a new month has started and it should create a new folder and "save as" the excel sheet in the new folder "September" after creating a folder named "september".

Please advise on this.

------------------------------
SWA
------------------------------
2 REPLIES 2

Vamshi_KrishnaD
Level 5
Hi Swati

you can build a logic, if the date is 1st, let you can create a folder with month name. using calculation you can derive it.

generally, take a decision whether date is 1st or not, if the date is 1st pass decision is true and create the folder with month name

------------------------------
VamshiKrihsna Dasa
System Architect
Fujitsu India Consulting Pvt. Ltd.
------------------------------
VamshiKrihsna Dasa System Architect Fujitsu India Consulting Pvt. Ltd.

Hi Swati

This is fairly straight forward and is a good thing to know as you'll probably use folders a lot in bot development. 

Using Utility - File management and the action "Directory exists" and set the directory to something like "C:\Folder path\"&FormatDate(Today(), "MMMMMMMMMMM") this will tell you if you folder for this month already exists (the argument "MMMMMMMMMM" defines the month as September, August, July etc or if the folder is set using the month number set this to "MM" and you get 09 for september). Using a decision you know whether to create it or no i.e. if this months folder doesnt exist then create it, the Directory exists action outputs to a success flag data item which you can use for this decision.

For creating the folder itself you can use the same utility with the action "Create directory" and you set the new folder in the same way "C:\Folder path\"&FormatDate(Today(), "MMMMMMMMMMM"). 

Hope this hase been helpful Swati 🙂

------------------------------
Michael ONeil
Senior Developer
Clydesdale and Yorkshire bank
Europe/London
------------------------------