cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iwonder
Impactful Individual
Impactful Individual

Notify Patch Error Message and Error

Thank you for taking the time to read my question.

 

I'd like to be able to notify my user of any error encountered when trying to Patch / update a record in a SQL table. In the following code .message is red and underlined saying it's a table not text. I don't understand how to fix this.

 

Patch('[dbo].[FacilityAccess]',LookUp('[dbo].[FacilityAccess]',AccessID = Value(DataCardValue1.Text)),{UserEmail:TextInput2.Text,IsQA:DataCardValue6.Value,IsAdmin:DataCardValue7.Value,FacilityAccess:lblSelectedFacilities.Text});
If(IsEmpty(Errors('[dbo].[FacilityAccess]')),Notify("Record Updated",NotificationType.Success),Notify(Errors('[dbo].[FacilityAccess]').Message,NotificationType.Error))

 

Thank you for your time

1 ACCEPTED SOLUTION

Accepted Solutions
yashag2255
Dual Super User II
Dual Super User II

@iwonder 

 

I am afraid but this is not doable as per current capabilities. If you think this should be added, please raise an idea or upvote of exists already here: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas 

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

4 REPLIES 4
yashag2255
Dual Super User II
Dual Super User II

Hi @iwonder 

 

Make sure that you have enabled "formula level error management" setting in Experimental features of Advanced Settings of the App. Then, you can try out the below expression:

Set(isSuccessful,true);IfError(Patch('[dbo].[FacilityAccess]',LookUp('[dbo].[FacilityAccess]',AccessID = Value(DataCardValue1.Text)),{UserEmail:TextInput2.Text,IsQA:DataCardValue6.Value,IsAdmin:DataCardValue7.Value,FacilityAccess:lblSelectedFacilities.Text}), Set(isSuccessful,false));If(isSuccessful,Notify("Record Updated",NotificationType.Success),Notify("Error encountered",NotificationType.Error))

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

iwonder
Impactful Individual
Impactful Individual

Hi @yashag2255 

 

Thank you for your quick reply. I was already able to do that. What I'd like to be able to do is instead of Notifying "Error encountered" I'd like to be able to show the Errors().Message and Errors().Error text so it's clear to the user what the error was. That way when they email me saying something went wrong we have more to go on.

yashag2255
Dual Super User II
Dual Super User II

@iwonder 

 

I am afraid but this is not doable as per current capabilities. If you think this should be added, please raise an idea or upvote of exists already here: https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas 

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

iwonder
Impactful Individual
Impactful Individual

Hi @yashag2255 

 

Thank you very much for letting me know. That's very unfortunate.

 

have a great day

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,249)