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

Community site session details

Session Id : W50P6XZd+czRT9oJLc7GdF
Power Automate - Building Flows
Unanswered

Having issues with updating a record from Dataverse Table to SQL Server "Primary key is compound by 0 elements but 1 were provided"

Like (0) ShareShare
ReportReport
Posted on 23 May 2024 14:02:12 by 97

I'm receiving an error when updating a record within my PowerApps application. I'm using a flow when a row is added, modified or deleted to update the SQL table with those changes. When updating a record, I'm receiving the following message.

 

"Primary key is compound by 0 elements but 1 were provided"

 

I've already confirmed that my primary key/column in SQL is "ID" as I have my Row ID for for the SQL update is set to the following function

 

"first(outputs('Get_rows_(V2)')?['body/value'])?['ID']"

 

I don't have any problems with adding a new record but when I'm updating a record I receive the error above. Can anyone help with updating my flow and or the function I'm using? I'm not sure what I'm needing to do to bypass this error so I can update the record. 

 

Cwilliams12_1-1716472345829.png

Cwilliams12_2-1716472394205.png

Cwilliams12_3-1716472441088.png

 

Cwilliams12_0-1716472281652.png

I have the same question (0)
  • developermct Profile Picture
    35 on 29 Jun 2024 at 01:28:04
    Re: Having issues with updating a record from Dataverse Table to SQL Server "Primary key is compound by 0 elements but 1 were provided"

    Based on the error message "Primary key is compound by 0 elements but 1 were provided", it seems there is a mismatch between the primary key definition in the table and the data being inserted or updated. Here are a few possible causes and solutions:

     

    1. The table definition may have an empty or incorrectly defined primary key. Check the table schema to ensure the primary key is properly defined with the intended columns.
    2. The INSERT or UPDATE statement may be trying to provide a value for a primary key column that is actually an IDENTITY column or is automatically generated. In this case, you should omit that column from the INSERT statement or remove it from the UPDATE statement's SET clause.
    3. There could be a trigger or constraint that is interfering with the operation. Review any triggers or constraints on the table.

     

    I hope that helps! 😊👍


    Darren Neese, Power Apps MVP ➡️ Get access to my free Power Apps crash course here: https://go.superpowerlabs.co/superlanding


    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up. 😊👍👍


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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 655 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 371 Moderator

#3
chiaraalina Profile Picture

chiaraalina 276

Last 30 days Overall leaderboard
Loading started
Loading complete