cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

When an existing list item is modified, update a SQL row

Hello,

 

I am new to Microsoft Flow and using the following template referenced in my subject line "When an existing list item is modified, update a SQL row ". 

 

I'm able to connect to my SharePoint List as well as to my SQL Table on the server, I'm testing the sync and trying to update the record in the table but keep getting the below error. I have two primary keys on my sql table which are "LoanNumber" and "Underwriter". I've looked online and cannot find how to solve for this, I am using "LoanNumber" as my ROWID required column on the SQL Update Row action.

 

 

{
  "status": 400,
  "message": "2 keys were specified, but 1 values were provided.\r\n     inner exception: 2 keys were specified, but 1 values were provided.\r\nclientRequestId: c5ed77df-1d1a-47c0-a0e9-cbfabe970bb4",
  "source": "sql-wus.azconn-wus.p.azurewebsites.net"
}

 

 

Any help in the right direction is greatly appreciated.

 

Thank you

7 REPLIES 7
Highlighted
New Member

Re: When an existing list item is modified, update a SQL row

I messed around with this some more and if I dropped the "Underwriter" primary key from my SQL table and just had the "LoanNumber" primary key then my flow worked correctly. The problem however is that the user could enter the same loannumber twice into the SP List so I can use LoanNumber only as primary key. There is an ID column which appears to be an identity column and is unique. My question now is should I change the primary key to be this ID column and map that or is there a way for me to have two or more identity columns and get the flow to recongize both in the singular ROW ID column in my flow?

Highlighted
Frequent Visitor

Re: When an existing list item is modified, update a SQL row

Hi guys,

 

I have the same issue here.....I have a table with two keys but I am only able to provide one of the keys in flow via the "Row id" field.....any chance the update sql action can accept multiple key fields?

 

Thanks

Highlighted
Regular Visitor

Re: When an existing list item is modified, update a SQL row

same here can some one help point the way to use combined primary key as Row ID?

Highlighted
New Member

Re: When an existing list item is modified, update a SQL row

Same issue. Has anyone found a solution?

Highlighted
Advocate III
Advocate III

Re: When an existing list item is modified, update a SQL row

Hello @kigenst 

 

My solution was to create a stored procedure that executes a sql statement. Then I just pass the update statement from the app to the stored procedure which will run it. Takes a little bit to get it set up and isn't perfect but it works well once it's up and running. Hope this helps.

Highlighted
Advocate I
Advocate I

Re: When an existing list item is modified, update a SQL row

Hi there,
Try to separate primary key values by comma.


Capture.PNG

 I have table with three keys and it works fine when tested. 
Capture.PNG

 
Hope it help.
ZZ

 



Highlighted
Advocate III
Advocate III

Re: When an existing list item is modified, update a SQL row

@zdenko_zahorec ,

Wow that's cool, I'll definitely give that a try!

 

Thank you!

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (10,071)