web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Problem using Patch - ...
Power Apps
Answered

Problem using Patch - record not found?

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

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

 

Categories:
I have the same question (0)
  • Verified answer
    v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    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 Power Platform Member Profile Picture
    Microsoft Employee on at

    @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

  • Arun_ta Profile Picture
    Microsoft Employee on at

    I am getting the same error but by changing the primary key doesn't work.

  • izzooot Profile Picture
    8 on at

    I also have the same issue. The columns I'm updating are not PK

  • eric1599 Profile Picture
    10 on at

    For me it's working for regular PowerApps, but does't work on government tenants. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard