cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Responsive Resident
Responsive Resident

The requested operation is invalid. 2 keys were specified, but 3 values were provided.

Hi,

 

Can someone help me with this error?  The context is when trying to use the function SubmitForm() I get the error below.  My data source is a SQL Server.  I have 5 other tables in this app and they are behaving just fine.  I am able to read and write to them in the same manner (submit form function).

 

keyIssues.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Responsive Resident
Responsive Resident

Re: The requested operation is invalid. 2 keys were specified, but 3 values were provided.

@mdevaney thanks for your help,

 

After spending quite some time on this, i think i found a solution/workaround.  Using the SubmitForm() function works on some records in the table but not all of them.  For every record i get the error there is one thing in common.  One of the columns that makes up the composite key has a comma in the data. 

I have replaced all the comma's with spaces and now no records produce the error.  Not sure if this is a known limitation I am just unaware of or this is something that PowerApps needs to address. 

 

My guess is that PowerApps uses the data in the primary key(s) in a csv fashion to write to the DB and comma's in the data is not accounted for.   It appears that commas in columns that are not part of the PK write just fine.  

View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

Re: The requested operation is invalid. 2 keys were specified, but 3 values were provided.

@samuelJ 

Are you working with composite keys in your SQL Table?  You are not allowed to change any value forming a composite key in your Edit Form.  Instead a new record would need to be created.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Responsive Resident
Responsive Resident

Re: The requested operation is invalid. 2 keys were specified, but 3 values were provided.

Hi @mdevaney ,

 

My understanding of a composite key is: a key that is made up of 2 or more columns.  Going off of this definition, yes the table I am using submitForm() on has a composite key.  However, all the other tables also use composite keys and they are working as expected.  I am also not editing the primary keys of the table.

 

Is there a way to easily do SubmitForm() an an update?

Highlighted
Super User III
Super User III

Re: The requested operation is invalid. 2 keys were specified, but 3 values were provided.

@samuelJ 

Hmmm... typically this error occurs when the composite key value is being updated.

 

What is difference between the forms that are working and the one that is broken?  Are the primary key fields included or excluded in those forms?  What else do you notice?

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Responsive Resident
Responsive Resident

Re: The requested operation is invalid. 2 keys were specified, but 3 values were provided.

@mdevaney thanks for your help,

 

After spending quite some time on this, i think i found a solution/workaround.  Using the SubmitForm() function works on some records in the table but not all of them.  For every record i get the error there is one thing in common.  One of the columns that makes up the composite key has a comma in the data. 

I have replaced all the comma's with spaces and now no records produce the error.  Not sure if this is a known limitation I am just unaware of or this is something that PowerApps needs to address. 

 

My guess is that PowerApps uses the data in the primary key(s) in a csv fashion to write to the DB and comma's in the data is not accounted for.   It appears that commas in columns that are not part of the PK write just fine.  

View solution in original post

Highlighted
Advocate I
Advocate I

Re: The requested operation is invalid. 2 keys were specified, but 3 values were provided.

Hi Samuel,

You have helped me understand the reason my flow is failing. Did you happen to find a solution to this problem without having to replace the comma in the text? 

Thanks,

Chandrika

Highlighted
Responsive Resident
Responsive Resident

Re: The requested operation is invalid. 2 keys were specified, but 3 values were provided.

Hello,

 

unfortunately, our solution was to tell the business commas are not allowed in the data any more.  

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,839)