Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Error Handling
Unanswered

IfError not work well with Set&Patch combination

(0) ShareShare
ReportReport
Posted on by 9

Hi,

 

IfError doesn't work when using code like this:

IfError(Set(varID,Patch(...),Notify("Error"))

 

Any ideas?

Nelson

  • Wood_Raymond Profile Picture
    20 on at
    Re: IfError not work well with Set&Patch combination

    Thanks @CarlosFigueira . Makes perfect sense when you put it like that. Cheers.

  • CarlosFigueira Profile Picture
    on at
    Re: IfError not work well with Set&Patch combination

    No - when we save the result of the Patch in a variable using the Set function, we are handling the error ourselves (by storing it). So it will not bubble up to the App.OnError handler.

  • Wood_Raymond Profile Picture
    20 on at
    Re: IfError not work well with Set&Patch combination

    @CarlosFigueira in this case if the Patch throws an error will it be an unhandled error and be caught by App.OnError??

     

  • CarlosFigueira Profile Picture
    on at
    Re: IfError not work well with Set&Patch combination

    The Set function will not return an error. In a formula such as Set(var, expression), if expression is an error then the value of 'var' will be that error - Set did what it was supposed to do. For your scenario, you can have something like the following:

    Set(varId, Patch(...));
    IfError(varId, Notify($"Error: {FirstError.Message}"))

    Hope this helps!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Error Handling

#1
stampcoin Profile Picture

stampcoin 58

#2
DS-11051211-0 Profile Picture

DS-11051211-0 20

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 9

Overall leaderboard

Featured topics