web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Error handling while d...
Power Apps
Unanswered

Error handling while doing multiple patches to multiple SharePoint Lists

(0) ShareShare
ReportReport
Posted on by

Hi guys, I'm currently working on a project where I have to make multiple patches to multiple SharePoint Lists. Now what I want to do is, if any one of the Patch() fails then the other patches  should also fail. I tried to implement this using IsError() like this,

Scenario 1: pass the ID of the first patch to the second patch

If(

IsError(

Set(

patchVal,

Patch(list1,Defaults(list1),{col:val})//Patch ends

)//Set ends

)//is error ends

,//condition ends

Notify("Error while patching")

,

Patch(list2, {col:patchVal.ID})

)

 

 

Scenario 2: the patches are unrelated

If(

IsError(

Patch(list1,Defaults(list1),{col:val})//Patch ends

)//is error ends

,//condition ends

Notify("Error while patching"),

Patch(list2, {col:val})

)

Now the problem with this approach is that, sometimes the first patch works correctly and I get an error on the second Patch() only. Is there any way to cancel the first patch also if the second one fails. Thanks in advance.

Condition: If any one Patch fails then all the other patches should also fail.

@mdevaney  @elseb @FLMike @WarrenBelz 

 

 

Categories:
  • Ethan_009 Profile Picture
    4,840 Moderator on at

    Hi @michaeldanieal ,

     

    You can use IfError function as well to detect error and then act up on.

    Also, similar work around is carried out by this blog [Blog Link].

     

    Hope this helps

  • michaeldanieal Profile Picture
    on at

    I read the blog, But I don't think this method would work if the internet connection is lost just after the first patch is completed. Any ideas/suggestions on that scenario. Thank you for replying.

  • elseb Profile Picture
    774 Moderator on at

    you could wrap your patch in a var and check that var for content.

     

    Set(varPatch1, PATCH_1_GOES_HERE),

    If(!IsBlank(varPatch1), PATCH_2_GOES_HERE)

  • michaeldanieal Profile Picture
    on at

    Hi, do you have a solution which would work if the internet connection is lost just after the first patch is completed. I want to rollback the first patch also if any one of the patch after it fails(even after internet is cut off after first patch).

  • elseb Profile Picture
    774 Moderator on at

    Hi, there isn't a nice and neat way to do that. You could save the ID of the first patch in each of the following in the chain, then check if you have the full sett when new patch is created, this of course would not fix the issue of missing full record etc. If you're worried about the internet dropping I'd look in SaveData, LoadData this way you could store the data on the device and if check Connection.Connected goes back to true, patch that saved data.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard