Pause a Flow using Delay and Delay Until | Power Automate

In some use cases, you want to pause a Flow either by a duration you specify or until the timestamp you specify.

Let’s look at both the ways – Delay and Delay Until in Schedule operation

undefined

Delay

In a simple application, you can make a Flow wait for a certain duration by using the Delay Action in Time

undefined
And I’m selecting a standard 3 min wait
undefined
And it will pause the execution until then
undefined

And resume the Flow after the Delay duration has been completed
undefined

Delay Until

Now, a variation to pausing a Flow until the timestamp you specify is achieved using Delay Until action the timestamp you specify
In my example, I’m using a Timestamp stored in a Time variable and the value is something like below

undefined

So, I can use the Delay until action and it accepts a TimeStamp. It accepts ISO8601 format.
undefined

And I’ll set a value, which contains my timestamp
undefined

In my case, based on the Timestamp stored in my variable, it’ll wait until the below shown time.
undefined

And will be completed when the timestamp is hit
undefined

And that’s it.

Here are some more posts that might help you –

  1. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  2. Text Functions in a Flow | Power Automate
  3. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  4. Get Count of records retrieved in CDS connector in a Flow | Power Automate
  5. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  6. Button Flow in Power Automate to replicate a Quick Create Form in D365 CE
  7. Make HTTP request from Flow in Power Automate
  8. Using Parse JSON to read individual List Records in Flow|Power Automate

Hope this helps!!

Advertisement

Text Functions in a Flow | Power Automate

As I was looking at some String/Text operations in Flow recently, here’s what I discovered.

Looks like there are a lot more to come, so let’s look at some initial ones.

undefined

Find text position

A pretty simple feature to find the position the Search Text starts from in a String.
undefined

Here, I’m trying to find where does ‘yes’ in string ‘Priyesh’ starts from in the given text. And the answer was 3. [Text Index starting from 0]
undefined

If the text doesn’t exist, the result is -1
undefined

Substring

Here’s another important Text function called Substring.

This will return the substring with starting index of 3 and the length of the string from the starting character.
undefined

In this case, it’ll return the string “yes”
undefined

If your Starting Position in Substring is out of the range i.e. exceeding the length of the entire string, you’ll see and error like below stating the issue.
Also, the same error will be displayed if the Length of the Substring chosen falls out of range i.e. the index exceeding end of the string.
undefined

Here are some more Power Automate / Flow posts you might want to look at

  1. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  2. Get Count of records retrieved in CDS connector in a Flow | Power Automate
  3. Number Formatting in a Flow | Power Automate
  4. Call a Dynamics 365 Action from Flow [Bound and Unbound Actions] | Power Automate
  5. Switch-Case in a Flow | Power Automate
  6. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  7. Using Parse JSON to read individual List Records in Flow|Power Automate
  8. Make HTTP request from Flow in Power Automate
  9. Enable Flow button on D365 Ribbon
  10. Button Flow in Power Automate to replicate a Quick Create Form in D365 CE

Implementing Exit app, Logout and Confirm Exit features in a Canvas Power App

Most common scenarios are where you need users to be able to Exit the Canvas Power Apps in the below ways –
Scenario – Let’s say you put a close button somewhere in your App.
undefined

  1. Exit the current App but stay logged-in to Power Apps.
  2. Exist and Logout Power Apps entirely.
  3. In both above cases, ask user for confirmation before exiting.

So let’ look at these scenarios one by one –

Exit from current App

  1. Now, let’s say you’ve put a Close button on your App like this. And when you click it –
    undefined
  2. It takes you to the App selection screen in your Power Apps
    undefined
  3. You can implement this using Exit() method on OnSelect property of the Close button as shown below
    undefined

    And that’s it.


Exit and Logout of Power Apps

  1. Another variation to the same feature would be to Exit the App as well as Logging out completely. Now, I’ve put a Lock button here to represent Logout.
    undefined

  2. You can implement this by using Exit(true) method as shown below
    undefined
  3. And, it will logout the PowerApps Application itself.
    undefined
    And you’ll need to log in all over again.

Confirm before Exit

This is a feature that will work with both, Exit() and Exit(true). It will ask you for a confirmation on whether if you really like to close/logout the app?

  1. Select App in the left-hand Tree view, select App
    undefined
  2. And look at the right hand Properties menu – The Confirm exit and Confirm exit message will let you enable this feature with the message you want to display –
    undefined

    And you can set your message
    undefined
  3. And then, when you either Logout or try to Close the App, you’ll be prompted with this message
    undefined


    Note: For all the changes to take place in Canvas Power App, make sure all changes are Published and you force close and re-open the Power App (if using on a mobile device / Tablet). Wait for a few seconds to get notified about the latest version being available.

And it’s all that simple! In case you are looking for more articles on Canvas Power Apps, you might want to check these below –

  1. Variables in Canvas Power Apps | Global and Context
  2. Get N:N records in a Canvas Power App using Common Data Service connector | Power Platform
  3. Adding a Canvas PowerApp to Teams
  4. Correctly connect to an Excel file in a Canvas PowerApp
  5. Sending Image from Canvas PowerApps to SharePoint Document Library using Flows

Hope this helps!

Setting Retry Policy for an HTTP request in a Flow | Power Automate

Often times, There could be an issue where your HTTP request isn’t hitting well. So, to overcome this, you might want your Flow to Retry after a certain duration and for some number of times.

You want to setup a Retry policy for the same. Here’s how you do it!

Setting Retry Policy

Follow this to setup a Retry Policy of your Flow

  1. Locate your HTTP step and navigate to Settings
    openSettings

  2. Once you’re in Settings pane, scroll below and look for Retry Policy.
    retryPolicyLocation

  3. Default type is set by default, if you expand it, you can select what should be the Retry Type. In  this example, I’ve set to Fixed Interval for simplicity
    Default is set to 4 retries at an exponential interval. (Exponential increment type is a little confusing to explain, you can check this post as users discuss how exponential time increments work – )fixedInterval
  4. In Fixed Interval type, I’ve set number of retry count to be 3 and duration between each retry should be 30 seconds (represented in ISO-8601 format)
    sampleRetrySet
  5. With that, the policy is set. And the HTTP request step will try for 3 times at the interval of 30 seconds each.

 

If you want to test using some HTTP request, you can sample HTTP requests from here – https://httpstat.us/

How it works

Look for Failed Runs to see the result –

  1. Open a Failed Run where you know HTTP request could have failed
    openFailedRun
  2. Now, look for your HTTP request where you set the policy on. Expand the same.
    openHTTPCallThatFailed
  3. Upon expanding, you can see that there were 3 retries and it failed due to a timeout i.e. 408
    failedRetries
  4. You can also check on the right hand side of the page which says that the total duration of all these retries were 1 min 30 seconds
    totalFixedTime

If you observe the Flow Runs, you can find the the Flow did consistently try to run at an interval for the number of times specified.

In case you’re looking for more Flow/Power Automate related posts, check below –

  1. Make HTTP request from Flow in Power Automate
  2. Using Parse JSON to read individual List Records in Flow|Power Automate
  3. Selecting (Current) in Environment in Power Automate CDS connector and why it matters
  4. Retrieve only active Dynamics 365 CE licensed Users in CDS connector in Power Automate
  5. Secure Input/Output in Power Automate Run History
  6. Approval Process using Power Automate
  7. Create a To-Do List Item of Important Outlook Emails using Power Automate
  8. RSS notifications to your phone using Power Automate
  9. Enable Flow button on D365 Ribbon
  10. Button Flow in Power Automate to replicate a Quick Create Form in D365 CE

Hope this helps!!