cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdrianPeterson
Regular Visitor

Respond to PowerApp from PowerAutomate - send 'success' message and navigate to the next screen

Hi Experts,

 

I would appreciate your help with the following:

 

  • I have created a button that navigates to the 'loading screen' and calls Power Automate flow
  • When flow is successfully processed, I want Power Automate to acknowledge the successful run and provide feedback to Power Apps by navigating from the 'loading screen' to 'success screen'.

Here is the code behind the button to call power automate flow:

 

  • I have created a button that calls a flow - I'm formatting two controls into strings using 'with' function and selecting data from PurchaseOrderHeadersV2 table.

 

With(
    {
        _jsonDataHeader: ShowColumns(
            AddColumns(
                Filter(
                    PurchaseOrderHeadersV2,
                    'Purchase order' = "PO-00005000"
                ),
                "HeaderNewConfirmedDate",
                '3A_NewConfirmedDateValue'.Text,
                "HeaderReasonCode",
                '3A_ReasonCodeValue'.Text
            ),
            "HeaderNewConfirmedDate",
            "HeaderReasonCode",
            "PurchaseOrderNumber",
            "dataAreaId"
        )
    },
    'UpdateDates-Header'.Run(
        JSON(
            _jsonDataHeader,
            IndentFour & IgnoreBinaryData
        )
    )
)

 

 

I tried experimenting with 'Respond to a PowerApp or flow' step but not sure how to incorporate the Set formula in my code above or how to leverage it to navigate to my 'success' screen.

 

AdrianPeterson_0-1619789507872.png

 

3 REPLIES 3
Pstork1
Dual Super User III
Dual Super User III

The current command to run the flow will run synchronously.  So it will wait for the flow to complete before the Power App moves on.  Just add a navigate command after the run command and when the flow completes it will navigate to the next screen.  Something like this.

ClearCollect(MyData, GetItemsDemo.Run(Value(TextInput2.Text)));Navigate(Screen2,ScreenTransition.Fade)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
AdrianPeterson
Regular Visitor

Hi @Pstork1, thanks for reply. This makes sense, I will amend my code for Power Automate button to:

 

1. Navigate to 'loading' screen

2. Call power automate flow

3. Navigate to 'process completed' screen

 

Still, would you be able to advise how to set the 'Status' variable in power app via flow? The picture in my original post includes the static value 'processed' but this could be replaced by another variable.

If you include a status value in the Respond to Power Apps action at the end of the flow you can store that in a variable when the flow returns.

Set(StatusVariable,'UpdateDates-Header'.Run(
        JSON(
            _jsonDataHeader,
            IndentFour & IgnoreBinaryData
        )
    )
)


-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (48,297)