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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,183)