Microsoft Flow - pause till date

Let's create a simple flow for the common scenario we encounter, send a notification on a certain date or wait till some date and perform an action.  In SharePoint designer workflow, we use the "Pause until" step to perform this. Similarly in Microsoft flow we will use the action "Delay Until".


Look at the below flow, we have action trigger whenever an item is created in the SharePoint list we will trigger the flow. Make sure to login with your Office 365 account when prompted. Provide the site url and then select the list for which you want to trigger the flow.

Next, add the delay until action and then use the date field which will the date till we need to pause the flow. Why do we have the Z after the due date, it might be weird but flow won't treat it as date in UTC format if we don't add one. As a next step we have "Send Email" action to send email after the delay period. Configure the to, subject and body of email per your requirement.


Flow run status when the due date is in past, that means there is no need pause the flow you can see the step status it executed in zero secs.

Flow run status when the due date is in future, the orange time lapse icon states that. Its waiting for the due date.

An important note here, the dates are in UTC. If you want your flow to wait as per your time zone then make sure to use date and time field in your List or have some logic to add time to the delay until action, otherwise its going to wait until UTC 00:00 hrs. which might not be the exact wait time.

Peace!

Comments

  1. How did you figure out to add a "Z" after the date?

    ReplyDelete
    Replies
    1. addDays(formatdatetime(triggerBody()?['Due_x0020_Date'],'yyyy-MM-ddThh:mm:ssZ'), -10)

      Delete

Post a Comment