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 Automate - Building Flows
Answered

Delay Until 2am

(0) ShareShare
ReportReport
Posted on by 159

Hello All:

 

I have a simple Approval flow that triggers upon recurrence every 3 days. It gets file properties and if file approval=pending it sends email to approver for approval. Our biggest challenge is that users are often in the files needing to be approved. Therefor when the the approver approves and the flow tries to update the file properties to 'Approve' it cannot do so because the file is locked for editing. The flow continues and errors but the approver is not aware of the fact that the file properties have not been updated. Then again on the third day they receive an email for approval of the same file because the properties are still=pending becuase the file was locked for editing and the metadata could not be updated on previous attempt. I have worked with this flow for months now and have tried just about everything. The only thing I have left is to try to add some kind of delay function into the flow to update the file properties at a specific time when the least amount of users are potentially in the file, say 2am. 

 

I am open to options here. I have not been able to successfully implement a delay in such a way that would only update at 2am. The closest I have been able to get is to delay updating for a given amount of hours say 10 hours. This presents a problem as well as hours of business are roughly between 6am and 6pm. So even if an approver approves at 6am sharp the metadata would then be updated at 4pm, which still falls between our business hours thus potentially leaving the file locked for editing. 

 

Any help or suggestions would be greatly appreciated.

 

Thanks all!

 

Tom

 

 

 

I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at
    Re: Delay Until 2am

    @tomh ,

     

    You could calculate how many hours are between utcNow() and 2am tomorrow and have the flow delay for that amount of time:

     

    the flow in the below screenshot does the following:

     

    1. Converts the current time in UTC (Universal Coordinated Time) to local timezone and returns only the Hours number (from a 24-hour format, so 1:00PM=13).

     

    2. subtracts the current hour from 26 and returns that figure. 26 is the number of hours there are from 00:00 on day one to 0200 (2:00AM) the following day. this calculation determines how many hour there are from right now to 0200 tomorrow morning.

     

    3. delays the flow for that many hours

    DelayFlow.png

     

    the expressions that you need are in the action block comments in the screenshot.

     

     

    I hope this helps!

     

    thanks,

    Kyle

  • Paulie78 Profile Picture
    8,418 Moderator on at
    Re: Delay Until 2am

    Is there a reason that I am not understand that you cannot just use the delay until action?

     

    DelayUntil;.PNG

  • Verified answer
    tom_riha Profile Picture
    10,179 Most Valuable Professional on at
    Re: Delay Until 2am

    Hello @tomh ,

    to delay until 2am the next day you can use the following expression inside 'Delay until' action.

    addHours(utcNow('yyyy-MM-dd'),26,'yyyy-MM-ddTHH:mmZ')

    utcNow('yyyy-MM-dd') will give you today's date at 00:00, to which you use the addHours() expression to add 26 hours to get tomorrow 2am and format it as 'yyyy-MM-ddTHH:mmZ' to fit the requirements of the 'Delay until' action.

    image.png

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Delay Until 2am

    It looks like I like doing things the hard way... @Paulie78  and @tom_riha 's solutions are much more simple and elegant.

  • Paulie78 Profile Picture
    8,418 Moderator on at
    Re: Delay Until 2am

    @Anonymous don't feel too bad about it. I came up with an elaborate solution also, which I think is quite neat! That is when I noticed delay until 😥

  • tomh Profile Picture
    159 on at
    Re: Delay Until 2am

    @tom_riha 

    Thank you for this. Are you saying that utcNow always returns time of 00:00? So, adding any hours to that figure will always update at set time regardless of whether the approval occurs at 7am or 3pm?

     

  • tom_riha Profile Picture
    10,179 Most Valuable Professional on at
    Re: Delay Until 2am

    @tomh 

    Expression utcNow() without parameter returns date and time when the action was executed = now. But you if you add a format parameter where you ignore the time part utcNow('yyyy-MM-dd') it'll give you 00:00 time.

  • tomh Profile Picture
    159 on at
    Re: Delay Until 2am

    Does this look correct?

    Rhia.JPG

  • tom_riha Profile Picture
    10,179 Most Valuable Professional on at
    Re: Delay Until 2am

    Yes, that looks just fine. 🙂

  • tomh Profile Picture
    159 on at
    Re: Delay Until 2am

    @tom_riha 

    Thank you again for this. I will test now and report back the success. 

     

    Tom

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 659 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 386 Moderator

#3
chiaraalina Profile Picture

chiaraalina 290

Last 30 days Overall leaderboard