cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdrianPeterson
Frequent 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
Frequent 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
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,250)