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

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

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 II
Dual Super User II

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

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?

 

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (77,495)