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

Problem using Patch - record not found?

Hi,

 

I have a PowerApp which is connected to a local SQL Server through a Data Gateway. On the click of a button, I am trying to update a specific record in a table. I am trying to use the following patch function:

 

 

Patch('[dbo].[SOP10100]', First(Filter('[dbo].[SOP10100]', SOPNUMBE = "QTEST1028")), {SOPTYPE:2, DOCID:"STDORD"})

The error that I am getting is the following:

powerapps1.png

I can't figure out what I am doing wrong...the record exists in my table:

powerapps2.png

 

Any ideas?

 

Thanks for the help,

Tudor

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Problem using Patch - record not found?

Hi @Tudor,

 

Yes the error could be reproduced from my side, only when I try to change the Primary Key value of the table.

So in your scenario, the change record part:

{SOPTYPE:2, DOCID:"STDORD"})

Is SOPTYPE or DOCID a primary key?

The Primary key defined under SQl table is acted as the row identifier, which is not allowed to change at the current time.

This should be a current limitation, I will collect this as a feedback from my side.

To workaround, please define another Primary key in the table, make sure the field that you would like to update is not configured as the primary key.

Regards,

Michael

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

Re: Problem using Patch - record not found?

Hi @Tudor,

 

Yes the error could be reproduced from my side, only when I try to change the Primary Key value of the table.

So in your scenario, the change record part:

{SOPTYPE:2, DOCID:"STDORD"})

Is SOPTYPE or DOCID a primary key?

The Primary key defined under SQl table is acted as the row identifier, which is not allowed to change at the current time.

This should be a current limitation, I will collect this as a feedback from my side.

To workaround, please define another Primary key in the table, make sure the field that you would like to update is not configured as the primary key.

Regards,

Michael

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

Re: Problem using Patch - record not found?

@v-micsh-msft

 

You are correct, I am trying to modify one of the segments of the primary key of my table. I know this is not a good idea in general but this is just for testing. 

 

Thanks Michael for pointing that out, I did not know that this was a current limitation. 

 

Tudor

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 93 members 4,334 guests
Recent signins:
Please welcome our newest community members: