{"id":58,"date":"2024-02-26T20:53:23","date_gmt":"2024-02-26T20:53:23","guid":{"rendered":"https:\/\/stroudsolves.com\/?p=58"},"modified":"2024-02-26T20:58:43","modified_gmt":"2024-02-26T20:58:43","slug":"create-a-time-delay-in-a-power-automate-flow","status":"publish","type":"post","link":"https:\/\/stroudsolves.com\/index.php\/2024\/02\/26\/create-a-time-delay-in-a-power-automate-flow\/","title":{"rendered":"Create a time delay in a Power Automate Flow"},"content":{"rendered":"\n<p><strong>Delay by time, a date or a day of the week<\/strong><\/p>\n\n\n\n<p>Welcome to my guide on mastering time delays in Power Automate. In the realm of automation, timing is everything, and being able to strategically delay actions can significantly enhance the efficiency and effectiveness of your workflows. Whether you&#8217;re orchestrating tasks, sending notifications, or triggering events, the ability to pause execution for a specific duration, until a particular date, or until a designated day of the week can be invaluable. In this guide, we&#8217;ll walk you through step-by-step instructions on how to seamlessly implement three distinct time delay techniques: delaying by minutes, delaying until a static date, and delaying until a specific day of the week. Let&#8217;s dive in and empower your workflows with precision timing capabilities.<\/p>\n\n\n\n<p><strong>1 &#8211; Delay by minutes<\/strong><\/p>\n\n\n\n<p>The sub title for this first section is &#8220;Delay by minutes&#8221;, but this brief how to will show you how to delay a flow for any such time.  First off, we will create a new flow.  In this example we will create an instant flow.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"819\" height=\"298\" src=\"http:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/1-instant-cloud-flow.png\" alt=\"\" class=\"wp-image-80\" srcset=\"https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/1-instant-cloud-flow.png 819w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/1-instant-cloud-flow-300x109.png 300w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/1-instant-cloud-flow-768x279.png 768w\" sizes=\"auto, (max-width: 819px) 100vw, 819px\" \/><\/figure>\n\n\n\n<p>Next, for this example we will start with a simple &#8220;Manually trigger a flow&#8221; so we can show the delay working in a real time test.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"909\" height=\"581\" src=\"http:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/2-manually-trigger-a-flow.png\" alt=\"\" class=\"wp-image-81\" srcset=\"https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/2-manually-trigger-a-flow.png 909w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/2-manually-trigger-a-flow-300x192.png 300w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/2-manually-trigger-a-flow-768x491.png 768w\" sizes=\"auto, (max-width: 909px) 100vw, 909px\" \/><\/figure>\n\n\n\n<p>Next we will search for the action of &#8220;Delay&#8221;.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"340\" src=\"http:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/3-add-delay-action-1024x340.png\" alt=\"\" class=\"wp-image-82\" srcset=\"https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/3-add-delay-action-1024x340.png 1024w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/3-add-delay-action-300x99.png 300w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/3-add-delay-action-768x255.png 768w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/3-add-delay-action.png 1122w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>The Delay action will give us two parameters to use.  This is where we can add a numeric value for the time delay, as well a unit.  In this example we will create a 1 minute delay.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"506\" src=\"http:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/4-add-1-minute-delay.png\" alt=\"\" class=\"wp-image-83\" srcset=\"https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/4-add-1-minute-delay.png 634w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/4-add-1-minute-delay-300x239.png 300w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><\/figure>\n\n\n\n<p>It is as simple as that to create the delay.  Save your newly created flow and do a quick manual test to make sure that it is working as expected.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"440\" height=\"348\" src=\"http:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/5-save-and-test-delay.png\" alt=\"\" class=\"wp-image-84\" srcset=\"https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/5-save-and-test-delay.png 440w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/5-save-and-test-delay-300x237.png 300w\" sizes=\"auto, (max-width: 440px) 100vw, 440px\" \/><\/figure>\n\n\n\n<p>The test will give you a nice green tick once its run.  You can see below that the delay action took 1 minute to perform which is exactly what we wanted to see.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"407\" height=\"308\" src=\"http:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/6-flow-success.png\" alt=\"\" class=\"wp-image-85\" srcset=\"https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/6-flow-success.png 407w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/6-flow-success-300x227.png 300w\" sizes=\"auto, (max-width: 407px) 100vw, 407px\" \/><\/figure>\n\n\n\n<p><strong>Delaying until a static date<\/strong><\/p>\n\n\n\n<p>Instead of selecting the &#8220;Delay&#8221; action, you can pick &#8220;Delay Until&#8221;.  This will allow you to add a exact date.  This is a useful ability to have, for example if you want to set reminders for tasks to be done in 3 months time, financial year reminders, and many other functions!<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>delaying until a specific day of the week<\/strong><\/p>\n\n\n\n<p>OK so this is my favourite use for a delay and has helped me build some very useful processes and flows in the past. It is the ability to delay until a day of the week.  In the example below we will be delaying a flow until it is a Friday.<\/p>\n\n\n\n<p>To do this, we will be using the &#8220;Delay Until&#8221; action again, however instead of adding a static date we want to go into the function (fx) options.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"431\" height=\"192\" src=\"http:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/7-add-function.png\" alt=\"\" class=\"wp-image-86\" srcset=\"https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/7-add-function.png 431w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/7-add-function-300x134.png 300w\" sizes=\"auto, (max-width: 431px) 100vw, 431px\" \/><\/figure>\n\n\n\n<p>We want to add in the following function:  <strong>addDays(utcNow(), sub(4, dayOfWeek(utcNow()))<\/strong><\/p>\n\n\n\n<p>The expression is used to calculate a date that is four days before the current day of the week.  To break it down:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code><strong>utcNow()<\/strong><\/code>: This function returns the current UTC (Coordinated Universal Time) date and time<\/li>\n\n\n\n<li><code><strong>dayOfWeek(utcNow())<\/strong><\/code>: This function extracts the day of the week from the current UTC date and time. The day of the week is represented as an integer, where Sunday is 0 and Saturday is 6.<\/li>\n\n\n\n<li><code><strong>sub(4, dayOfWeek(utcNow()))<\/strong><\/code>: This part of the expression subtracts the day of the week (obtained in step 2) from 4. This effectively gives you the number of days to subtract from the current date to get to the previous occurrence of the same day of the week.<\/li>\n\n\n\n<li><code><strong>addDays(utcNow(), sub(4, dayOfWeek(utcNow())))<\/strong><\/code>: Finally, this function adds the number of days calculated in step 3 to the current UTC date and time. This results in a date that is four days before the current day of the week.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"342\" src=\"http:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/8-add-days-function-added-1024x342.png\" alt=\"\" class=\"wp-image-87\" srcset=\"https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/8-add-days-function-added-1024x342.png 1024w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/8-add-days-function-added-300x100.png 300w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/8-add-days-function-added-768x256.png 768w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/8-add-days-function-added.png 1124w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Test the flow to make sure its calcuating corrects as per below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"557\" src=\"http:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/9-successfully-runs-1024x557.png\" alt=\"\" class=\"wp-image-88\" srcset=\"https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/9-successfully-runs-1024x557.png 1024w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/9-successfully-runs-300x163.png 300w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/9-successfully-runs-768x417.png 768w, https:\/\/stroudsolves.com\/wp-content\/uploads\/2024\/02\/9-successfully-runs.png 1402w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>We have a video on Youtube showing this full process.  Check it out!<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"Create a time delay in a Power Automate Flow - Delay by time, a date or a day of the week\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/LT1QBCx41Xo?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Delay by time, a date or a day of the week Welcome to my guide&#8230;<\/p>\n","protected":false},"author":1,"featured_media":87,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[1],"tags":[22,23,20,21],"class_list":["post-58","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howto","tag-delay-a-flow","tag-delay-until","tag-how-to","tag-power-automate"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/posts\/58","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/comments?post=58"}],"version-history":[{"count":7,"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/posts\/58\/revisions"}],"predecessor-version":[{"id":96,"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/posts\/58\/revisions\/96"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/media\/87"}],"wp:attachment":[{"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/media?parent=58"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/categories?post=58"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stroudsolves.com\/index.php\/wp-json\/wp\/v2\/tags?post=58"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}