I'm looking to set up a flow that determines which fiscal year (which starts after September 30 each year) a date column falls under, then place that item in the appropriate fiscal year folder in a document library. For example, if the date is 7/15/24, it will go into the Fiscal Year 24 folder of the document library. Is there a way to set this up without doing a conditional for each fiscal year?
Thanks for the response. With this flow, I would only be able to categorize the current and next fiscal year, correct? Is there a way to set up more than two years without setting up a conditional for each year?
You will need to adapt this to your specific needs, but you can try this:
The expression in the condition is the following. Replace triggerBody()['date'] with the dynamic date value that determines the fiscal year. It will return a number for the month. If it returns 1-8 it is the current fiscal year, otherwise it is the following fiscal year.
int(formatDateTime(triggerBody()['date'],'MM'))
For the folder path expression, use the following for the current year:
concat('/fiscalyear/', formatDateTime(triggerBody()['date'],'yyyy'))
Note: first use the folder picker to select the document library on your SharePoint site, and then paste that into the expression. For example, the document library I tested this on is 'fiscalyear'; be sure to include the backslashes.
For the next fiscal year, use this expression:
concat('/fiscalyear/', string(add(int(formatDateTime(triggerBody()['date'],'yyyy')),1)))
Again, do the same as above for the document library and folder path. This expression gets the current year and adds 1 to it.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492