I would like to create a Flow to replace our existing leave request process. One of the items we need to do is to calculate the number of business days that an employee is requesting. This calulation needs to consider weekends and company holidays. We currently have a SharePoint list of holidays but we do not have anything for weekdays.
Is there a way to accomplish this in Flow?
Our current workflow vendor requires a number of exasperating steps to accomplish this including making a list of all requested days, removing the days that start with the letter "S" then removing any days that are located on our holiday list. I would love to be able to replace the software...
I am afraid that currently there is no directly way can be used to achieve your scenario.
You may have to remove the weekends first, then remove the company holidays.
This documentation about workflow definition language for your reference:
I've got half your answer - calculating the end date, factoring in weekends. I've published a single forumula at https://sharepointgurus.net/microsoft-flow-formula-calculate-due-date-excluding-weekends/. You'll need to add two variables - startdate and duration. The formula will work out the end date.
Holidays can be tricky as it depends on the person's location. In Australia, different States have variations to holidays. If you are dealing with multiple countries, then that is more challenging. You'll need to get a list of appropriate holidays between your start and end date and then increase your end date by the appropriate amount. You could maintain a list in SharePoint of public holidays per region for the next 10 years and update yearly. Maybe there is an existing service out there that has all that logic built in.
I've discovered the solution to this issue for another user here on the community, and I have written a blog article that explains the solution in detail. Check it out here:
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Check out the on demand sessions that are available now!
ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.
Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!