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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Approval Flow Time out...
Power Automate
Suggested Answer

Approval Flow Time out setting should only count weekdays

(1) ShareShare
ReportReport
Posted on by 150
Hello:

when setting the time code for an approval workflow action  - how can we ensure that only weekdays are being counted?  If the Time out is P3D, how can we make sure if the flows triggers on a Friday that the time out will be on a Wednesday and not Monday.

The flow where I need to use this is very complex so code efficiency would be important.

Appreciate any help 

DublinOH User
Categories:
I have the same question (0)
  • Suggested answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    The duration in a timeout uses the ISO 8601 duration format standard, which does not directly support excluding weekends. To achieve this, you can use the `dayOfWeek(utcNow())` expression to get the current day of the week, where Sunday is represented by 0 and Saturday by 6. You would then need to calculate the number of days to add to this number to account for weekends. This involves determining how many weekend days fall within your desired duration and adjusting accordingly. For example, if you need a duration of 3 days but want to exclude weekends, you would:
    1. Use `dayOfWeek(utcNow())` to get the current day.
    2. Calculate the total number of days, including weekends.
    3. Adjust the duration by adding extra days to skip over weekends.
    This process requires custom logic to handle the weekend exclusion, but it is doable. Once you have the adjusted duration, you can create a variable and use it in the ISO 8601 format, such as `P3D`.

    I have this note where I tried this, but I don't know if I got the expression to work. You could start with this, which I think I was trying to allow 10 business days: 

    if(or(equals(dayOfWeek(addDays(utcNow(), 10)), 6), equals(dayOfWeek(addDays(utcNow(), 10)), 0)), 12, 14)



  • lbendlin Profile Picture
    8,479 Super User 2025 Season 2 on at
    what's your definition of "weekday"?  What should happen if the workflow starts on a "not weekday"  ?
  • DublinOH_User Profile Picture
    150 on at
    Thank you for the replies. However this is the situation...

    We have a 3 stage approval with each level of approval having a different time setting.  The solution suggested of using a variable to adjust the flow run sounds a little complex.

    If I understand

    I would have to use the complete date of the approval response to configure "some kind of wait action" that has to find the day of the week for the most recent approval, and either run or wait based on the day week???

    Or  

    I would have to use the complete date of the approval response to find the day of the week for the most recent approval and if that date is for example a Friday then wait 2 days, or if its Monday skip the wait action? Is the wait action in a scope?

    DublinOH User

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard