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
Solved! Go to Solution.
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!
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.
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!
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
255 | |
122 | |
85 | |
75 | |
72 |