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.
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?
Solved! Go to Solution.
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});
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});
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!
User | Count |
---|---|
253 | |
109 | |
92 | |
48 | |
37 |