cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
beniwal
Level: Powered On

Error Handling and rollback

Hi,

 

Is there any rollback kind of functionality available in powerApps? 

 

I am using the below formula onSelect of a button:- (noteid is an auto-incrementing PK of SN table)

 

UpdateContext({callBack:
Patch('[dbo].[SN]',Defaults('[dbo].[SN]'),{

Note: Gallery3_9.Selected.Body,
NoteType: nT
}) });


If(IsBlank(callBack.noteid),

Notify("Something Went Wrong Try again",NotificationType.Error),

Patch('[dbo].[NB]',Defaults('[dbo].[NB]'),{ NoteID: callBack.noteid,
SId: id});

 

My concern is that what if my 2nd patch through some error because of any issue! 

Should I delete the record which is inserted by the 1st patch function?

 

Or there is any better way to do it!

 

Please guide, Thanks in advance 🙂

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Error Handling and rollback

Hi @beniwal 

 

there could be numerous reasons, data source unavailable, permissions got updated and hence user cannot save/update item, column got deleted in data source etc.

 

Regards,

Reza Dorrani

 

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

3 REPLIES 3
Dual Super User
Dual Super User

Re: Error Handling and rollback

Hi @beniwal 

 

You would have to delete the record inserted by the first patch

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

beniwal
Level: Powered On

Re: Error Handling and rollback

Hi @RezaDorrani ,

 

Thank you for your response!

 

I want to discuss more on it, like what are the potential reason for a patch failure? 

 

Specifically, I am asking if multiple users are inserting records in these tables "SN" and "NB", can that be one reason for patch function failure?

 

Dual Super User
Dual Super User

Re: Error Handling and rollback

Hi @beniwal 

 

there could be numerous reasons, data source unavailable, permissions got updated and hence user cannot save/update item, column got deleted in data source etc.

 

Regards,

Reza Dorrani

 

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,770)