Using SQL server update rows action with uniqueidentifier as a primary key

Veli-Jussi Raitila 426 Reputation points
2024-01-23T16:02:32.1366667+00:00

I have a table in Azure SQL database with a field of uniqueidentifier type as a (non-clustered) primary key.

Trying to update the table with update rows action - using the 'primaryKey' property - gives me the following error:

{ "code": "ServiceProviderActionFailed", "message": "The service provider action failed with error code 'BadRequest' and error message 'Invalid input for primary key. Ensure that a value for each field in the primary key is provided.'." }

The primary key consists of a single field and I have provided a value for it. Why does it not work?

EDIT: Clarification that the issue occurs in Logic Apps Standard using the InApp update rows action for SQL Server.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,245 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,731 Reputation points
    2024-01-26T11:01:05.2433333+00:00

    @Veli-Jussi Raitila Thanks for more clarification on the action.

    I was able to reproduce the issue and got the exact error that you have mentioned if I am passing the incorrect primary key for my table.

    In the action, please make sure you are passing the primary key value correctly as below. Using the same table schema that I have shared previously I was able to update the FName field in my table. Make sure that you are passing the primary key without double quotes or mentioning the column name etc. as it is not needed. If you want to update multiple rows then you need to pass the primary key values separated by comma.

    You can click on advance parameters and then select the Primary key or the where condition as per your need.

    User's image

    enter image description here

    In case if you are still facing the issue then please share the screenshot of the primary key that exists on the table along with your action value from the trigger history.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.