web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Scheduled Cloud flow w...
Power Automate
Unanswered

Scheduled Cloud flow with alternating Times based on the Week

(0) ShareShare
ReportReport
Posted on by 12

Hi,

I am trying to build a scheduled Flow to activate my OOO message. The thing is my shift alternates between 8-16:30 and 9:30 to 18:00 every week.

 

Currently I am using two flows both set to trigger every second week.

 

I am wondering if I can somehow use only one flow. Maybe with the custom Frequency feature but I couldnt find anything that works.

Categories:
I have the same question (0)
  • Verified answer
    Pstork1 Profile Picture
    68,678 Most Valuable Professional on at
    Re: Scheduled Cloud flow with alternating Times based on the Week

    In this particular case I think using two flows is your only choice.  The other option I have used with some clients is to isolate the triggers in separate flows and then have the trigger flows call a child flow.  In your case that would actually mean 3 flows.  The advantage would be that two of the flows would just be the recurrence trigger and an action to launch the 3rd flow.  So maintaining the main flow can all be done in one place.

  • Niromas Profile Picture
    12 on at
    Re: Scheduled Cloud flow with alternating Times based on the Week

    Feared as much, but thought I'd ask anyway.

     

    Thank you anyways  🙂

  • David_MA Profile Picture
    12,908 Super User 2025 Season 2 on at
    Re: Scheduled Cloud flow with alternating Times based on the Week

    I might have something for you. Since weeks are either odd or even numbered, and your schedule recurs every other week, one of them is always on an odd week and the other is even. You can use the following expression to tell if the current date is an odd or even numbered week:

    if(equals(mod(add(div(dayOfYear(utcNow()),7),1),2),0),'Even','Odd')

    Running this today would return odd, because it is the 19th week of the year. Depending on when you run the flow, you may need to adjust utc(Now() to add days so you get the correct week you want to set your OOO notification.

     

    You can then use the output of the above expression in a Switch so the flow branches to send the correct message for that week.

  • Niromas Profile Picture
    12 on at
    Re: Scheduled Cloud flow with alternating Times based on the Week

    Definetly gonna try that thank you

  • David_MA Profile Picture
    12,908 Super User 2025 Season 2 on at
    Re: Scheduled Cloud flow with alternating Times based on the Week

    This is a breakdown of what the above expression does:

    • dayOfYear(utcNow()): This function gets the current day of the year.

    • div(dayOfYear(utcNow()), 7): This expression divides the current day of the year by 7 to get the current week number.

    • add(div(dayOfYear(utcNow()), 7), 1): This expression adds 1 to the current week number to ensure that the first week of the year is considered week 1, not week 0.

    • mod(add(div(dayOfYear(utcNow()), 7), 1), 2): This expression calculates the remainder of dividing the adjusted week number by 2, which will be 0 for even weeks and 1 for odd weeks.

    • equals(mod(add(div(dayOfYear(utcNow()), 7), 1), 2),0): This expression uses the equals function to check if the remainder is equal to 0, which indicates an even week. If it is, the expression returns 'Even'. If it is not, the expression returns 'Odd'.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard