Hi!
I'm creating a workflow of reminders but I'm kinda stuck at the moment.
I have created this list:
and until now I'm testing by triggering the workflow manually but it's going to be a scheduled workflow. The workflow consists of sending a reminder 3 days in advance, 1 day in advance and on the same day as the date entered in the field (Compliance date and / or report). Until there, everything is fine!:
What has been difficult for me is how to calculate what the working days are, in this case Monday through Friday. I need to exclude Saturdays, Sundays and holidays.
¿What should i do to make it work?
Could you please help me! and I really appreciate it.
Thank you very much for your answer.
Until now I have had no success to exclude weekends at least.
I've done this:
In the "compose" block, I have this expression:
I have worked on a flow that will calculate the end date given the start date and the number of working days. This formula will exclude weekends. You might be able to use this to get the working days. Another option would be to use an unattended UI Flow and run a calculation in Excel to return the number of working days.
https://docs.microsoft.com/en-us/power-automate/ui-flows/overview
This is the expression in Compose 2 - Compose 3 outputs the end date.
if(equals(dayOfWeek(adddays(if(equals(dayOfWeek(variables('startdate')),6),addDays(variables('startdate'),2), if(equals(dayOfWeek(variables('startdate')),0), adddays(variables('startdate'),1),variables('startdate'))), add(mul(7,div(variables('duration'),5)), mod(variables('duration'),5)))),6), addDays(adddays(if(equals(dayOfWeek(variables('startdate')),6), addDays(variables('startdate'),2), if(equals(dayOfWeek(variables('startdate')),0), adddays(variables('startdate'),1),variables('startdate'))), add(mul(7,div(variables('duration'),5)), mod(variables('duration'),5))),2), if(equals(dayOfWeek(adddays(if(equals(dayOfWeek(variables('startdate')),6), addDays(variables('startdate'),2), if(equals(dayOfWeek(variables('startdate')),0), adddays(variables('startdate'),1),variables('startdate'))), add(mul(7,div(variables('duration'),5)), mod(variables('duration'),5)))),0), adddays(adddays(if(equals(dayOfWeek(variables('startdate')),6), addDays(variables('startdate'),2), if(equals(dayOfWeek(variables('startdate')),0), adddays(variables('startdate'),1),variables('startdate'))), add(mul(7,div(variables('duration'),5)), mod(variables('duration'),5))),1), adddays(if(equals(dayOfWeek(variables('startdate')),6), addDays(variables('startdate'),2), if(equals(dayOfWeek(variables('startdate')),0), adddays(variables('startdate'),1),variables('startdate'))), add(mul(7,div(variables('duration'),5)), mod(variables('duration'),5)))))
WarrenBelz
146,601
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,942
Most Valuable Professional