cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
iwonder
Post Prodigy
Post Prodigy

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!

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!

View solution in original post

Hi @yashag2255 

 

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

 

have a great day

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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