cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Resolver III
Resolver III

Workaround for OnSuccess when using Patch?

I have a desktop canvas app which contains a heavily customized form. Because of customizations required, I did not want to use the form control. Instead I am using individual controls and patching their values to my data source. 

One thing I like about using forms is the ability to use OnSuccess. There is additional logic that I want to run after the initial patch, but I only want it to run if the patch was successful.

Is there any way to check if the patch was successful and only run proceeding logic if it was successful?

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User III
Dual Super User III

If the Patch() is successful it will return the record that you just created/updated.  You can check for that value and if you get it then the patch worked.  If it didn't work then the value will be Blank.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

3 REPLIES 3
Dual Super User III
Dual Super User III

If the Patch() is successful it will return the record that you just created/updated.  You can check for that value and if you get it then the patch worked.  If it didn't work then the value will be Blank.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Super User III
Super User III

OnSelect of your Button:

If(IsEmpty(Errors(Datasource)),Notify("Record Has Been Patched Successfully"),

Notify("The Process Could Not Be Completed, Record not Added"))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Super User III
Super User III

@Cooper01 

In addition to the responses given to you - you might also want to check out my video on Forms (especially Part 3) for some options on using the EditForm in a complex form situation.  EditForms do have some really nice built-in features that otherwise you have to create on your own.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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