Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Try/catch on patch function

Hello Team,


I would like to have some kind of error handling when my app writes to DB using patch function. How do we confirm in powerapps that patch function actually did what it supposted to do? I'm trying to do Patch inside Try/Catch so if any issues happens (like network connectivity issue etch) during the patch execution, I want to know.


please advise how I can implement this.


Thank you.

Super User
Super User

Hi @vshah804 

Patch() does not directly return an error message but there is documentation regarding how to both validate your data before a patch and how to use the IsEmpty() function to check for errors.  Please review canvas-apps/functions/function-errors and see if this helps. 

Community Support
Community Support

Hi @vshah804 ,

Do you want to confirm whether the patch function perform well?

The first way is to check whether it has error message.

The second way, I suggest you insert a gallery.

Set the gallery 's data source to your DB table.

After performing patch function, check the gallery to see whether items change.


Best regards,

Community Support Team _ Phoebe Liu


Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Not applicable

Hi @vshah804 how are you progressing with this? Were the above replies helpful? 



Helpful resources

Ignite 2022


Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (2,104)