cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
guyinazo
Level 8

Making sure a patch is successful

Is there an easy way to make sure a Patch was successful?  I have the end user entering some demographic data and then saving it and on Success I want a Summary button to enable (instead of its default state of disabled) that will take them to their Summary screen).  And if there is some error in the Patch, I would like it to log and show and error.

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Making sure a patch is successful

You can set a variable to be the result of a PATCH operation, e.g.

Set(varReturnedRecord,Patch(MyTable, Defaults(MyTable),{Field: MyValue}))

You can then check to see if that returned record is zero. This is also handy for getting the identifier of a newly created record.

If a varReturnedRecord is empty, I think you can then also use the errors function to determine the error, e.g.

Set(varError, Errors(MyTable, varReturnedRecord))

More info here: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-errors 

To clear errors from a table/record, you can use the Revert function.

View solution in original post

1 REPLY 1
Super User
Super User

Re: Making sure a patch is successful

You can set a variable to be the result of a PATCH operation, e.g.

Set(varReturnedRecord,Patch(MyTable, Defaults(MyTable),{Field: MyValue}))

You can then check to see if that returned record is zero. This is also handy for getting the identifier of a newly created record.

If a varReturnedRecord is empty, I think you can then also use the errors function to determine the error, e.g.

Set(varError, Errors(MyTable, varReturnedRecord))

More info here: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-errors 

To clear errors from a table/record, you can use the Revert function.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,384)