cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vshah804
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.

3 REPLIES 3
Drrickryp
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. 

v-yutliu-msft
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.
Anonymous
Not applicable

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

 

@Anonymous 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT 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.

Users online (1,762)