This post demonstrates a practical example where controlled folders in SharePoint have benefits not easily done with metadata. This use-case is for a Finance team who work with financial documents throughout the year requiring the documents be made Records once the fiscal month is over and the documents for the month are complete.
The easiest way to do this is with folders, however… I want to automate folder creation to guarantee a standard structure each fiscal year and to prevent end-users from “willy-nilly” creating the folders themselves. This was previously possible by the Send an HTTP request to SharePoint Flow action, but with the recent addition of the Create new folder action in Microsoft Flow, this just got a whole lot easier!
Here’s how the process works end-to-end. This is something that could be done for many teams, but particularly Finance since they often work on a time-period basis.
- Turn off folder creation at the library level in advanced settings. (You don’t want manual folders being created in the library)
- Configure a retention label to comply with your own retention requirements and ensure the Label is set to classify the document a record when the label is applied
- Build a Microsoft Flow to run once at the start of each fiscal year. The Flow will automatically create a Fiscal year parent folder and 12 Fiscal year month sub-folders within it using the new Create new folder action. (Steps D,E)
The Flow to create the fiscal folders has 5 steps (steps A-C explained below):
Step A: This Flow will run once at the start of each fiscal year.
Step B: Initialize the Fiscal year string variable to be in this format: CCYY-YY where the current year is CCYY and next year is YY (Example: 2019-20):
the value is this formula:
concat(formatDateTime(utcNow(),’yyyy-),formatDateTime(addDays(utcNow(),365),’yy’))
Step C: Since we want to create a number of consistently-named subfolders, the best way to do this is by creating an array of folder names in an array variable, FiscalMonths:
Folders created!
In the TeamMonthlyProcesses document library, here’s the folders created for the current fiscal year once the flow runs! How convenient. 🙂
What happens when the fiscal month documents are done?
This can be done manually by setting the retention label on the folder (setting the retention label for the month of July is shown).
Here’s what happens when the retention label is applied to the folder:
Alternatively, you can trigger this action in an automated way thru Microsoft Flow. Refer to my post, Setting a Retention Label in SharePoint from Microsoft Flow, for details on how to do this.
The choice of folders versus metadata is a complex one and there are numerous factors to consider. This post is a good example to demonstrate how folders can help with organizing documents and applying retention. With the new Microsoft Flow Create new folder action, it’s even easier to build out solutions like this!
Thanks for reading.
-JCK
Credit: Photo by Andrew Pons on Unsplash

