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

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,540)