cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoePike
Frequent Visitor

Patch only on successful form submission BUT form has two buttons

Hi there so pretty much have the same issue as this guy

handling a SubmitForm failure

And I had already come to my own conclusion that I should use onSuccess, until it dawned on me that the form has an approve and reject button.

 

How would I get around failed form submissions with two buttons?

 

Could I do something like add an if statement in the OnSuccess to detect the buttons selected state? does that state even exist in the scope of OnSuccess?

 

I can't believe I'm the only one that has come across this requirement before but can't seem to find much on the matter

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @JoePike ,

Set a Variable (two different ones) on each button.

At the OnFailure event, you can choose which item to action. I would also reset the relevant variable after actioning this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

 

 

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @JoePike ,

Set a Variable (two different ones) on each button.

At the OnFailure event, you can choose which item to action. I would also reset the relevant variable after actioning this.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

 

 

@WarrenBelz  sounds like a solution to me! Something else that was advised was to separate the submission functionality from the approve and reject action, either on the browse screen or by adding a save/update button and using that for submission (neither which seemed like a user friendly approach)

 

Your solution sounds like something that should be implemented by Microsoft don't you think? Buttons could have an onSuccess or OnSubmit value that could be blank or if populated could be fed to the forms OnSuccess value

Thanks @JoePike ,

Agree with all you have said - one thing you get used to in Power Apps is working with the tools you have available. After a while you just get the accept this . . .

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,303)