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 Automate / The key didn't match a...
Power Automate
Unanswered

The key didn't match any rows in the table

(0) ShareShare
ReportReport
Posted on by 12

I have a flow that consists of a button that triggers a strored procedure through an On-Prem data gateway to SQL Server.

 

When building the flow, the connection finds the list of stored procedures correctly so I can choose from the drop down list.

 

When running however, I get an error message:

 

{
  "status"400,
  "message""The key didn't match any rows in the table.\r\n     inner exception: The key didn't match any rows in the table.\r\nclientRequestId: 5145f632-8916-478b-9468-e1280192bf5f",
  "source""sqlconnectionprovider-westeurope.am2-ase-001.p.azurewebsites.net"
}

 

This broadly seems to be the same error message as if I type the SPROC name in incorrectly, but I can't figure out why it's happening. Any ideas?

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

    Hi @Melakh

     

    Could you please share a screenshot of the configuration of your flow?

     

    The error message told that the key didn't match any rows in the table,I afraid that there is something wrong in your flow's configuration.

     

    Please check your flow to see if you have some configuration wrong in the flow.

     

    Best regards,

    Alice

  • GabrielStJohn Profile Picture
    Microsoft Employee on at

    Hey, @Melakh!

     

    It appears as though  would like some more information in order to further assist you properly with your issue. Please share any additional information that was requested in order to decrease the amount of time that it will take for you to be assisted!

     

    Thank you for being an active member of the Flow Community!

     

    -Gabriel

    Flow Community Manager

  • duncfair Profile Picture
    54 on at

    Same issue:

     

    The key didn't match any rows in the table. inner exception: The key didn't match any rows in the table. clientRequestId: A67FCF0B-8D02-4492-B022-C6C784CFCE34

     

    Both the Sharepoint list and the table in SQL Server have a column called PivotID. It is an identity column set as Primary Key in the SQL table and is unique within the sharepoint list. I have added the [Current] column as added Dynamic content as the value to be updated in the target SQL Table.

     

     

  • duncfair Profile Picture
    54 on at

    I created a copy of this flow using Windows Authentication rather than basic, and it seems like that resolved the issue reported above. Now it looks like it SHOULD work but I get a failure with the following message.

     

    {
      "status"400,
      "message""We couldn't convert to Number.\r\n     inner exception: We couldn't convert to Number.\r\nclientRequestId: c88507a3-e827-45f9-98e2-e6c3e9e09d68",
      "source""sqlconnectionprovider-westus.tip0-westus.p.azurewebsites.net"
    }

  • duncfair Profile Picture
    54 on at

    Now I get no error but the whole thing just hangs. The "To see it work now, modify a list item in the Sharepoint folder you selected. This may take a few moments." has been there for well over 10 minutes.

     

    No failure, no success.

  • duncfair Profile Picture
    54 on at

    Clicked edit, made no changes, then tested again. Same error.

     

    Body
    {
      "status"400,
      "message""We couldn't convert to Number.\r\n     inner exception: We couldn't convert to Number.\r\nclientRequestId: 106464c3-b0b8-4f9d-b6b6-ed71227c6ed9",
      "source""sqlconnectionprovider-westus.tip0-westus.p.azurewebsites.net"
    }

     

  • agilmore Profile Picture
    4 on at

    Re the error: "The key didn't match any rows in the table"

     

    When you run a Flow, the "Run Flow" dialog has an "edit connections". I found that the Flow was being run with the wrong SQL Server connection (I had more than 1 defined). I change to the correct connection and it ran fine. 

     

    Effectively this error message means "Flow can't find your table in the database". 

  • MatthewBrooksST Profile Picture
    24 on at

    I was getting this error and the cause was that the SQL account I was using for my connection didn't have read/write access to the database.  Once I gave the account the proper access, the connection worked successfully.

  • bkeano Profile Picture
    136 on at

    Just as a note here

     

    Power Automate will show you a list of procedures in a DB, but that does not mean you have the rights, in your connection, to perform all the actions in the procedure. For example, your connection may have DB read and write only, but the procedure maybe creating and dropping tables, so the user calling the procedure does not have the rights.

     

    It looks like Power Automate cannot determine this until the stored procedure is ran, then it interprets the failed response from the SQL server as 'key didn't match...'. Perhaps the error mesage could be improved here.

     

    If you do not want to give your Power Automate connection\user more rights on a DB level, can simply change the procedure itself in SQL DB to be run by a diferent user than the one calling it.

     

    Example

    You have a connection on Power Automate with a SQL Auth type user with just read and write rights on the SQL DB level

    The procedure you are running creates and drops tables.

    Your Power Automate will not have rights to do this and you'll get the error ' the key didn't match....'

    Instead of using or altering your connection with more rights, you can alter your proedure by adding the below line 'WITH EXECUTE AS 'DOMAIN\User' after the 'create\alter Procedure as' line

     

    Now you can use the same connection in Power Automate and the procedure is run on server level by a user with elevated rights

     

    Also see https://docs.microsoft.com/en-us/sql/t-sql/statements/execute-as-clause-transact-sql?view=sql-server-ver15 

     

    Hope this helps someone.

     

  • MingLeiNL Profile Picture
    2 on at

    I encountered the same error. The root cause is that the gateway user of PowerAutomate has NOT been granted with a permission to execute the stored procedure, although the error message is misleading.

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 Automate

#1
Haque Profile Picture

Haque 67

#2
David_MA Profile Picture

David_MA 64 Super User 2026 Season 1

#3
Expiscornovus Profile Picture

Expiscornovus 39 Most Valuable Professional

Last 30 days Overall leaderboard