cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
manjotsingh057
Level: Powered On

Patch expression not working

I am trying to update SQL record. The expression on button select is 

Patch('[dbo].[TestRequest]',First(Filter('[dbo].[TestRequest]',TID=207)),{job:"test"}); 

 

It is not throwing any error but not able to update the record as well.

 

Any suggestion, what is the issue here ?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
manjotsingh057
Level: Powered On

Re: Patch expression not working

@v-xida-msft

That was a typo error. Actually same table is referenced in both places. I corrected it now.

However issue is resolved. There was some syntax error.

 

Thanks..

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Patch expression not working

Hi @manjotsingh057,

Based on the formula that you provided, I think there is something wrong with the formula that you provided.

If you want to update an existing record within your AND_MaterialRequests SQL table using Patch function, you must find the record you want to update firstly within the AND_MaterialRequests SQL table (same data source).

But within the formula that you provided, the First(Filter('[dbo].[TestRequest]',TID=207)) formula would find a record within the TestRequest SQL table rather than the AND_MaterialRequests SQL table.

More details about the Patch function within PowerApps, please check the following article:

Patch function

 

On your side, you should modify your formula as below:

Patch(
'[dbo].[AND_MaterialRequests]',
First(Filter('[dbo].[AND_MaterialRequests]',TID=207)), /* <-- find the existing record witin same data source */
{
job:"test"
}
)

or

Patch(
'[dbo].[AND_MaterialRequests]',
LookUp('[dbo].[AND_MaterialRequests]',TID=207), /* <-- find the existing record witin same data souce */
{
job:"test"
}
)

More details about the LookUp function within PowerApps, please check the following article:

LookUp function

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
manjotsingh057
Level: Powered On

Re: Patch expression not working

@v-xida-msft

That was a typo error. Actually same table is referenced in both places. I corrected it now.

However issue is resolved. There was some syntax error.

 

Thanks..

View solution in original post

Community Support Team
Community Support Team

Re: Patch expression not working

Hi @manjotsingh057,

Have you solved your problem?

 

If you have solved your problem, please consider take a try to turn off/disable the "Improved app rendering (final validation)" option within Advanced settings of App settings, then check if the issue is solved.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,987)