cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DileepGolla
Advocate V
Advocate V

Flow validation in PowerApps

Hi,

We have a form where the User fills the data and click the Submit button. Then the data will be saved to the SQL table and email notifications are sent using Flows and the User will be navigated to the confirmation screen.

 

Button.Onselect: MyFlow.Run();Navigate(ConfirmationScreen,ScreenTransition.None)

 

Is there a way where we can check if the Flow has been actually executed before the user is navigated to the confirmation screen? I have checked the OnSuccess property of the Form, it works if we are using SubmitForm() and I am not sure how to validate the Flow instance.

 

Any help on this would be greatly appreciated.

 

Regards,

Dileep

1 ACCEPTED SOLUTION

Accepted Solutions
v-micsh-msft
Community Support
Community Support

Hi @DileepGolla,

 

The Flow.Run() would generate a result within PowerApps to indicate whether it has been executed successfully.

If it succeed, the result would be true, otherwise, it will run in false.

You may take a try to add a button and implement the following code to check:

ClearCollect(FlowResult, MyFlow.Run() )

The FlowResult collection would just show a Value column with the result to 'true' or 'false'.

 

So if here you would like to navigate to another screen based on the success result of the flow running, the formula should be written as :

If( MyFlow.Run(), 
    Navigate(ConfirmationScreen,ScreenTransition.None),
    true)

The logic here is when the Flow Runs, it will check the running result, if succeed, navigate to another screen, otherwise returns true to stay with current screen, you may also define other actions if flow fails.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-micsh-msft
Community Support
Community Support

Hi @DileepGolla,

 

The Flow.Run() would generate a result within PowerApps to indicate whether it has been executed successfully.

If it succeed, the result would be true, otherwise, it will run in false.

You may take a try to add a button and implement the following code to check:

ClearCollect(FlowResult, MyFlow.Run() )

The FlowResult collection would just show a Value column with the result to 'true' or 'false'.

 

So if here you would like to navigate to another screen based on the success result of the flow running, the formula should be written as :

If( MyFlow.Run(), 
    Navigate(ConfirmationScreen,ScreenTransition.None),
    true)

The logic here is when the Flow Runs, it will check the running result, if succeed, navigate to another screen, otherwise returns true to stay with current screen, you may also define other actions if flow fails.

 

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello, 

 

I have a MyFlow.Run() method that is returning true when a flow fails. 

Are there any other ways to check the results of a Flow in PowerApps? 

Yes, my Flow also fails and returns true

My problem is that some flows aren't even starting so this method would still be useful for me.

@SChorkawy wrote:

Hello, 

 

I have a MyFlow.Run() method that is returning true when a flow fails. 

Are there any other ways to check the results of a Flow in PowerApps? 


That's because it started (yay!), it just didn't finish successfully (boo). I don't know of any way of reading back the progress of a flow, besides adding steps in the flow which update some table of field. Your PowerApp can then read that field.

 

Has anyone figured out how to return that even though the flow ran, the process it ran did not run successfully?  I have a process that creates a PDF file, if the file is already there, the creation fails but since the flow ran, it returns success. I would like it to return a failure code so that I can report that back to the power app.

 

Assuming your files are stored on SharePoint, you could use a "Get files (properties only)" step, loop through the output of this step, and set a variable to say the file was found.

 

Hairy_Drumroll_3-1629853700081.png

Hairy_Drumroll_1-1629853413003.png

Hairy_Drumroll_2-1629853466612.png

 

HD.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (3,282)