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

Notifications

Announcements

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard