Running a flow on every weekday or certain weekdays
Rather than using Flow’s recurrence trigger with a frequency of “days” combined with switch cases/conditions, you can actually just use the “Week” frequency time unit and select days from a drop-down with no further effort required.
For weekdays, just select Monday-Friday. Or if you just want MWF, you could do that as well.
A techie way to do it
The alternative is to initialize a variable such as
with a switch case to determine if today’s date is, in fact, between 0 (Sunday) and 7 (Saturday).
Compare today’s date with holiday calendar
So that being said, the limitation of using the “Week” frequency for weekdays might be if you want to prevent it from running on holidays when nobody is in the office even if it is, in fact, a Monday. In that case, you could add a condition that checks to see if @utcNow() matches items from a SharePoint list (holiday calendar?).
- Initialize variable (integer) value 0
- Get items from SP list (calendar)
- You could add an ODATA filter in the Get items step to only filter to items with Start times greater than today
- Apply to each –> IF utcNow()=SP item, THEN increment variable by 1, ELSE nothing
- Use the expression builder to formatDateTime both dates to be sure they match when being compared
- IF variable is greater than 0, do nothing (don’t run), else run the rest of the Flow