Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Error handling patch function

(0) ShareShare
ReportReport
Posted on by

Hello together,

 

I have a question concerning error handling in PowerApps.

In my app I have some buttons, that do patches into different sharepoint lists with one click. Now I got the information from the app users, that sometimes a network error while using patch function occures. I still wasn t able to identify the reason for the error.

My fear is, that an error with just one of the for example three patches in an onselect generates invalid data, because two patches work fine and the other one fails. Result would be, that you need to correct the third list or the other two sharepoint lists manually that they are on the same data level again.

Does anybody have some idea whats the best way to deal with this problem? My idea was to implement kind of restruction, that if one patch generates an error the other patches won't run, too.
I think a problem is the order of the patches, because when for example the third patch creates an error, there is no more possibility to stop the patches before.

 

Thanks for your ideas,

 

Lukas

  • cdwhite Profile Picture
    1,067 Most Valuable Professional on at
    Re: Error handling patch function

    My only other thought is whether you can use the Validate and/or DatasourceInfo functions to pre-check all 3 patches before they’re actioned.

     

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-validate


    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-datasourceinfo

     

  • luwu_7100 Profile Picture
    on at
    Re: Error handling patch function

    Hey, thank you.

    Actually I haven't implemented any error handling, but I was thinking about something like you said.

    But my problem is, this will prohibit problems only when the error would be in the first patch. Because when Patch 1 is successfull and Patch 2 generates an error, then Patch 1 is already done and can't be stopped.

    But thanks for the link to the blog 🙂

  • cdwhite Profile Picture
    1,067 Most Valuable Professional on at
    Re: Error handling patch function

    Hello,

    Have you currently implemented any error handling on your Patch statements? If not, I'd suggest doing that first. Matthew Devaney has an excellent blog about how to get going:

    Power Apps Patch Function Error Handling - Matthew Devaney

    You could then bake in the logic of only running Patch 2 if Patch 1 is successful, only running Patch 3 if Patch 2 is successful, etc

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard