PowerApps – Patch Function show error details
Patch function will submit data from PowerApps to Destination Data location. Sometimes we may not see if patch is successful or failure in the PowerApps until we see the record in Destination location.
By using Error Functions in PowerApps we will Notify the
Patch errors. Error, IfError, ISError, IsBlankOrError functions will be helpful
to detect the errors in the Action. But all these functions will be available
in Experimental features in PowerApps. To get the functions, we need to enable
the Experimental Features in PowerApps in Settings
-> Upcoming Features -> Experimental as below.
Error Function will allow us to see if there is any error on
patching the Destination. We can add Error function for patching as below.
If(IsEmpty(Errors('<<Destination>>',
Patch(<<Destination>>,
Defaults(<<Destination>>),{<<Column>>:"<<Value>>"}))), Notify("Patching for the lists Completed",NotificationType.Success),Notify("Issue with patching. Error - ",NotificationType.Error))
On the above command, we are patching Destination database with
the values. In the Error function will return the errors. If there is no error
IsBlank function will run to true and Successful notification will be displayed.
If there are any errors, Error notification will be displayed with the error
message.
Comments