Notify users in Power Apps when a flow has run successfully

29th June 2022

Are you using Power Apps triggered flows when creating Canvas Apps? In this post we’re going to look at how you can trigger a notification back to your user to let them know that a flow has run successfully. For example, we might have a function in our app to send an email, we’re going to add capability for our app to tell us that our email has sent successfully.

Creating our Power Apps flow

So here I have a Power Apps based flow which will trigger from within a Power Apps application. I am using the PowerApps trigger here to be able to utilise this flow from within my Canavs app.

I will add the flow steps relevant to my business requirement, in this example I am taking some data and putting it into a HTML table which I then put into a PDF file with some additional content and formatting.

At the end of my flow, this is where I need to add the steps that will send some data back to my Power Apps application.

Here I am taking the last step of the flow, or you could use a scope to implement better error handling, and I am then adding the ‘Respond to a PowerApp or flow’ step below this step. You will notice I have added two of these steps as parallel branches.

One of these steps will be for a successful flow run where the previous steps have run successfully, and the other will be if a previous step hasn’t run successfully.

Screenshot of a Power Automate, Power Apps triggered flow

Configure run after

You might be wondering how we tell Power Automate which of the flow steps to run. To do this, we need to configure ‘run after’ on each of these flow steps. We will configure one where the previous step was successful, and the other where it wasnt.

Simply click on the elipses on the flow step you want to configure and select configure run after. Then select the first check box for the step you want to tell your app that the flow was successful.

Then mirror the same on the other parallel step but choose the bottom 3 checkboxes.

Then on each of your respond to an app steps, create an output variable of type text, and with the one with only ‘is successful’ selected for configure run after, assign the value true and for the other assign the value false.

Now we need to do some work in our Power Apps application!

Configuring our flow in Power Apps

So in my Canvas app, I’m going to trigger the flow I’ve created when I select a button. So in this case I need to select the OnSelect property of the button I want to click to make my flow run, then I need to add some syntax to the formulas bar to get my flow to work.

First I need to add my flow into my app, so I’m going to select ‘Action’ in the command strip and select Power Automate, then I’m going to make sure my button is selected and select my flow. Now you will notice your flow has been added to the OnSelect property of your button, but we still have some formula to write.

Screenshot of the OnSelect property of my flow trigger button within my Canvas app

So, you’ll notice the syntax here is a bit different to just running a flow normally when we want to return data to our application. Here we want to provide the flow with inputs and outputs if we have both in our flow, and in my case I do! I need to provide some inputs the flow needs for a send an email step and then I need to tell Power Automate the action I want to take based on the output it provides.

So I’m going to put my normal syntax for running the flow without output inside an IF statement. Here is the syntax for if my flow didn’t have outputs. Note that the properties for input I have provided here are based on my flow and yours will likely be different, if you have any at all!


Now for my flow that is going to provide an output, I simply want to put this in an IF statement where I follow this type of logic:

If my flow runs and the output property is equal to such a value, then do this, otherwise do this. To translate this into some plain english!…

If my flow runs and the success output property returns ‘true’, then I’m going to do an action which will be notifying my users that the flow ran successfully, but otherwise / if this is not the case, I’m going to notify my users that the flow was unsuccessful and they should check the result, and then contact their system administrator or IT.

The syntax to do this is:

If('FLOWNAME'.Run(User().Email,User().FullName).success="true",Notify("Notification Text Here for success",Success,10000),Notify("Notification text here for failure",Error,10000)

Remember my input properties within the brackets for my flow run are based on my flow’s business requirements, and yours will likely be different, so you need to change these.

I hope this helps, and you find that your users experience when engaging with your app is better through you communicating to them more when they make actions in your application!

Posted in Power Apps, Power Automate, UI/UX
  • Muhammed Naseef

    how to get error messages from the custom connectors

    9:45 am 30th June 2022 Reply
    • Lewis Baybutt

      Hi Muhammaed!I will certainly add this to my list of topics to take a look at. I’ll admit I haven’t done much learning around API’s or custom connectors yet, but as soon as I do, this will be a topic to take a look at after 🙂

      5:43 pm 8th July 2022 Reply
  • HubSite 365

    Sounds like a very nice post. We have added it to our directory. Follow our account for more information about #SharePoint #Microsoft365 content.

    10:39 am 30th June 2022 Reply
    • Lewis Baybutt

      Thank you so much guys! You’re awesome 🙂

      5:42 pm 8th July 2022 Reply
  • Tristan

    Hello,I am having the same need, except that I d like to send back a notification at each « Apply each » loops inside the flow, so not only one a the end. Do you think it’s possible?

    8:37 am 2nd October 2022 Reply
    • Lewis Baybutt

      Hi Tristan,

      I’m afraid I don’t think this is possible. You might notice an error when trying to save your flow if you do this. We can only send a response back once in our flow or we can have this step multiple times on the same branch where only one of the actions will take place.

      3:21 pm 5th October 2022 Reply

Leave a Reply

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

This will close in 0 seconds