cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Vaida
Helper II
Helper II

How to not run Power Automate Flow with a button if any errors in the PowerApps Form

Hello Everyone,

 

Happy Holidays!

 

I have added a Power Automate Flow to a button in PowerApps and I want it not to run in case there are any errors in the Form.

 

I used the same IfError formula as I did for my patch(do not run the patch in case any errors in the Form). However, it does not trigger my from with this error formula. The formula seems fine under the OnSelect property - I get no errors there. The Power Automate flow is triggered in case it is not in the IfError formula, but I only want it to be triggered when there are no errors in the Form. Is there a way to do that with PowerAutomate flow just like with the Patch function?

 

Vaida_0-1672141328413.png

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
LaurensM
Super User
Super User

Hi @Vaida,

 

Could you make a small adjustment (in your IfError). Between the Patch() and FlowName.Run, there should not be a comma (see your first screenshot) but a semicolon:

 

//You submit the form and check for errors
IfError(SubmitForm(FormName),
//Notify if there are errors
Notify(...),
//Here you Patch if no errors
Patch(...);
//Run the flow after your patch - no IfError() you already checked for errors initially
FlowName.Run(...)
)

View solution in original post

@LaurensM  I just figured where the problem: instead of "SharePointIntegration.SelectedListItemID" I added "SharePointIntegration.Selected.ID" and it works now!

View solution in original post

6 REPLIES 6
LaurensM
Super User
Super User

Hi @Vaida,

 

With the current setup you are actually submitting the Form twice if the first one has no errors.

If you only want the flow to run when the Form has no errors, you can just write the code after your Patch() statement, since you already check for errors before the Patch.

 

There is no need to check for errors on the same form again. Below an overview of how your code structure should look like:

 

//You submit the form and check for errors
IfError(SubmitForm(FormName),
    //Notify if there are errors
    Notify(...),
    //Here you Patch if no errors
    Patch(...);
    //Run the flow after your patch - no IfError() you already checked for errors initially
    FlowName.Run(...)
)

 

If this solves your question, would you be so kind as to accept it as a solution.

Thanks! 

@LaurensM  thanks for coming back to me! I tried this way too - but still the same, my flow is not triggered..

Vaida_0-1672146297679.png

It Only gets triggered when I add it separately without the IfError Formula:

Vaida_1-1672146360840.png

 

LaurensM
Super User
Super User

Hi @Vaida,

 

Could you make a small adjustment (in your IfError). Between the Patch() and FlowName.Run, there should not be a comma (see your first screenshot) but a semicolon:

 

//You submit the form and check for errors
IfError(SubmitForm(FormName),
//Notify if there are errors
Notify(...),
//Here you Patch if no errors
Patch(...);
//Run the flow after your patch - no IfError() you already checked for errors initially
FlowName.Run(...)
)

@LaurensM  just tried it, still the same, my flow does not get triggered:

Vaida_0-1672146929637.png

 

@LaurensM  I just figured where the problem: instead of "SharePointIntegration.SelectedListItemID" I added "SharePointIntegration.Selected.ID" and it works now!

LaurensM
Super User
Super User

@Vaida great work! Glad I could be of help.

 

Would it be possible to close the topic & accept one of the comments as a solution. This way other community members find the solution more easily when they run into a similar problem.

 

Enjoy your holidays!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,257)