Notifications
Announcements
Hi,
IfError doesn't work when using code like this:
IfError(Set(varID,Patch(...),Notify("Error"))
Any ideas?
Nelson
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!
@CarlosFigueira in this case if the Patch throws an error will it be an unhandled error and be caught by App.OnError??
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.
Thanks @CarlosFigueira . Makes perfect sense when you put it like that. Cheers.
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 796 Most Valuable Professional
Michael E. Gernaey 327 Super User 2025 Season 2
Power Platform 1919 268