cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RavChop
Frequent Visitor

"Success" Message after a flow run

Hi, 

 

I'm fairly new to PowerApps and I find myself struggling a little. 

 

I have a Button with the action OnSelect that triggers a flow Run to check-in something to a table - I was wondering if it would be possible to add a success message to let the user know that something has been "Checked-In Successfully" 

 

I've had a look at the Notify function in Power Apps but I don't know how I would be able to implement that alongside the flow.Run() function. Any ideas? 

1 ACCEPTED SOLUTION

Accepted Solutions
fugixi
Resolver II
Resolver II

Welcome to the community!

 

Certainly, this can be done.

It does require you to add an output parameter to your flow, like below.

Power Automate output parameter to PowerApps.png

 

What I have done here is I have added a parallel branch which will trigger if the previous step (Send an HTTP request... in my case) fails. However, for trying this out, you could start with only one branch and have the success = True statement.

 

IMPORTANT!

As soon as you change input and/or output to a Power Automate flow, which you already have added to a PowerApps, needs to be removed and added anew within your PowerApps applications.

 

Now, in PowerApps for your OnSelect event property, you can have something like the below expression:

If(
    'Power Automate Flow to Run'.Run().success = "True",
    Notify(
        "Flow has run successfully.",
        NotificationType.Success,
        2000
    ),
    Notify(
        "Flow run has failed.",
        NotificationType.Error,
        5000
    )
);

 

_______________________________________________________________________________________________________________________
Did this post solve your problem? Please click Accept as Solution so that others may find it more quickly.
If you liked my response, please give it a Thumbs Up.
Do you want to hear more from me? Visit my blog Marble's Power Corner.

View solution in original post

4 REPLIES 4
VineetDesai
Frequent Visitor

Hi @RavChop ,

 

In your Power Automate, after the action that performs the check-in, add "Respond to a PowerApp or Flow" action to send data back to the parent PowerApp

VineetDesai_0-1614001463036.png

Choose the type of data to be sent back (Text in your case?) and save the Power Automate flow. 

VineetDesai_1-1614001646069.png

In your PowerApp, store the value returned by the PowerAutomate flow in a variable using the SET command. (You may need to remove and add the Power Automate connection before you perform this step)

 

SET(varStatus, PowerAutomateFlow.Run(params).status);

 

You can notify the user on the basis of the value stored in the variable set above.

fugixi
Resolver II
Resolver II

Welcome to the community!

 

Certainly, this can be done.

It does require you to add an output parameter to your flow, like below.

Power Automate output parameter to PowerApps.png

 

What I have done here is I have added a parallel branch which will trigger if the previous step (Send an HTTP request... in my case) fails. However, for trying this out, you could start with only one branch and have the success = True statement.

 

IMPORTANT!

As soon as you change input and/or output to a Power Automate flow, which you already have added to a PowerApps, needs to be removed and added anew within your PowerApps applications.

 

Now, in PowerApps for your OnSelect event property, you can have something like the below expression:

If(
    'Power Automate Flow to Run'.Run().success = "True",
    Notify(
        "Flow has run successfully.",
        NotificationType.Success,
        2000
    ),
    Notify(
        "Flow run has failed.",
        NotificationType.Error,
        5000
    )
);

 

_______________________________________________________________________________________________________________________
Did this post solve your problem? Please click Accept as Solution so that others may find it more quickly.
If you liked my response, please give it a Thumbs Up.
Do you want to hear more from me? Visit my blog Marble's Power Corner.

View solution in original post

Hi @fugixi 

 

I have created an APP that enables a driver to capture fuel purchases, on screen 1, the user enters the details of the purchase, then on screen 2, the user takes a photo of the receipt.

 

Once the photo has been taken, the user clicks on submit which triggers a flow. The Flow will find the Fuel Purchase Record, Create a Note, attach the image and set the regarding to the Fuel Purchase Record. 

 

This all works perfectly except for the fact that the if() statement is causing the Flow to run twice. The below image shows the OnSelect expression. in this expression, I have added the params from the Flow, because as per your formula, there are no params. When I leave out the params the formula does not accept.

Run Flow on submit of receipt.PNG

 

Here is the error when the params are left out.

Error on params.PNG

 

I have raised a ticket with support, however, they have yet to respond as to why the flow is running twice.

I have managed to resolve the issue, turns out that I could have just wrapped the FlowName.Run() in an If statement which would handle the trigger and the response, not sure how but it does.

 

The updated expression now works perfectly.

logixcrm_0-1633255516432.png

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,506)