cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
illmatic
Helper IV
Helper IV

Get multiple Power Automate outputs into PowerApps

I have canvas app that submits a form to SP.  I would like to display an outcome screen that shows a success message which contains OutputA from a flow, and a failure message that displays only if OutputB equals 200.  

 

Right now, the OnSuccess property of my form in the PowerApp is set to create two variables which will hold OutputA and OutputB in Labels.   Set(FinalMsg, nameofFlow.Run(Form1.LastSubmit.ID).finalmsg);  Set(FailureMsg, nameofFlow.Run(Form1.LastSubmit.ID).failureMsg); Navigate(outcome);

 

This means the flow runs twice to set each of the variables.  Is there any way that I can set both variables within one call?    Here is the output for the action 'Responds to PowerApps' in the flow.

flow_respondToPA.png

 

 

 

Finally, on the Outcome screen I have set the OnVisible property of the screen to the following:  UpdateContext({results:If(failureMsg=200, false});     The error I get is that failureMsg cannot be evaluated because it is saved as a string and 200 is an integer.  Is it possible to format 200 as a string in PowerApps?  Or, should I convert failureMsg to an integer in the Flow?

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

You can change the formula to run the flow once and put both values in a variable and then use that one variable with a dot notation. For the If() in the UpdateContext() you can convert the 200 to text or convert the failureMsg to a number.

 

Example of flow call:

Set(varFlowreResponse, nameofFlow.Run(Form1.LastSubmit.ID));

 

Example of using the variable:
varFlowreResponse.finalmsg

varFlowreResponse.failuremsg

 

Output workarounds:

Convert 200 to text

UpdateContext({results:If(failureMsg="200", false});

or convert failureMsg to a number
UpdateContext({results:If(Value(failureMsg)=200, false});

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

2 REPLIES 2
Jeff_Thorpe
Super User
Super User

You can change the formula to run the flow once and put both values in a variable and then use that one variable with a dot notation. For the If() in the UpdateContext() you can convert the 200 to text or convert the failureMsg to a number.

 

Example of flow call:

Set(varFlowreResponse, nameofFlow.Run(Form1.LastSubmit.ID));

 

Example of using the variable:
varFlowreResponse.finalmsg

varFlowreResponse.failuremsg

 

Output workarounds:

Convert 200 to text

UpdateContext({results:If(failureMsg="200", false});

or convert failureMsg to a number
UpdateContext({results:If(Value(failureMsg)=200, false});

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
illmatic
Helper IV
Helper IV

Thank you, this worked like a charm :).  I don't know why I was thinking I needed to create an array of the flow responses!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,649)