07-12-23 10:41 AM
How to Create Year Month and date wise folder
07-12-23 01:39 PM
Hi Ankit,
In object 'Utility - File Management', you'll find an action 'Create Directory'. That action will create a new folder with your chosen name.
How's that 'Foundation' course coming along?
07-12-23 02:11 PM
Hi Ankit,
Thank you for being a SS&C Blue Prism customer and for using Blue Prism.
I think I can help you here.
Using the File Management VBO and the Create Directory action, you can create a folder very easily, all you have to do is provide the path to the folder you wish to create. It will throw an exception if you try to create a directory that already exists.
The potentially more complex part comes in creating the folder path, or more specifically the folder name in terms of a date.
If you have a date value, then you can build the folder name as follows.
Create a new action in a VBO.
Create a Date data item and for ease call it DateIn.
Create a Text data item and for ease call it Date Out.
In your objects action, create a calculation stage that accepts a date.
In the expression area type the following: FormatDateTime([DateIn], "yyyy-MM-dd")
Set the Store Result In drop down to the text item you created, Date Out.
Now, place a valid date value in the Date In data item, if you have not already done so.
Connect the stages and if everything is correct you will see the YMD value in the Date Out, all you need to do from here is pass that out of this action and into an action using the Create Directory action of the File Management VBO.
For future reference, I will see about adding this functionality to the strings VBO as it may be of use elsewhere.
Come back to me if you need more help.
regards
07-12-23 03:44 PM
You could always use a little known feature of the underlying .Net Format() method of Blue Prism Date Formatting functions. You can use pretty well any characters as long as you enclose them in double quotes and use backslashes that are escaped with another back slash. So for instance:
FormatDateTime(Today(), """Z:\\Reports\\Year-""yyyy""\\Month-""MM, MMM""\\Day-""dd, dddd")
Will produce a result of "Z:\Reports\Year-2023\Month-12, Dec\Day-07, Thursday".
------------------------------
Micheal Charron
Senior Manager
RBC
America/Toronto
------------------------------