Does anyone now of a way where Power Apps can be notified of when a flow triggered from within the app fails?
I have a button that runs a flow for a SQL stored procedure, then runs another command within the app. Problem is, if the flow fails, I don't want the next command to run. I know I can build other checks to prevent the following commands to run, but would be easy if some status code for success or failure could be returned.
When you start a flow from inside Power Apps it runs synchronously. You can use a Respond to Power Apps or an HTTP response to return results or a status code back to Power Apps. Inside the flow You can use Run After settings to control what happens if a particular action in the flow fails. So you need to configure the Run After settings to set a status code when the action fails in flow and then return that status code to Power Apps.
Ah, OK - I see how this works now. Didn't realize you could do this.
Next question is, where is Power Apps can I retrieve the results when I tell the flow to return the results?
In the On Select property where you run the flow, simply save the results of that Run() to either a variable or collection (depending on whether you are returning a status code or a set of results). Like this
Set(flowstatus,flowname.run(parameters to pass)) # or ClearCollect(flowresults,flowname.run(parameters to pass))
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
Featuring samples like Return to the Workplace and Emergency Response Applications
Features releasing from October 2020 through March 2021