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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / duplicate key value in...
Power Automate
Unanswered

duplicate key value in SQL

(0) ShareShare
ReportReport
Posted on by 4

Hi All,


I am currently working on a flow that writes data from 7 different forms (MSForms) into a SQL database.


I am currently receiving an error message: Violation of PRIMARY KEY constraint 'dbo.MY_DB'. Cannot insert duplicate key in object 'dbo.MY_DB'. The duplicate key value is (5).

This happens because I have multiple forms running in the same table in my SQL DB. Since each form has a separate form ID, this causes problems in the SQL DB afterwards. e.g. Id 3 from Form1 and Id 3 from Form7.

 

Now my question: Is there a way that the form ID's (primarykeys) are always incremented so all the id's of all forms are always unique?

 

Thanks in advance and best regards

 

Categories:
I have the same question (0)
  • PrasadAthalye Profile Picture
    on at

    Form Response ID across different forms wont be unique.  You will have first response Id as 1 in every form. But Form ID which is a GUID will be different.  You can Append Form ID with Form Response ID and then make that as a Primary Key. 

  • WFCH Profile Picture
    4 on at

    Hello Prasad,

     

    Thanks for your reply.

     

    And how exactly would I do this? Does this mean i should connect Form ID with the Form Responce ID and make them together one primary key?

  • PrasadAthalye Profile Picture
    on at

    Yes that is what I recommend.

  • PrasadAthalye Profile Picture
    on at

    @WFCH - Did you get chance to alter Key and see if it works?

  • PrasadAthalye Profile Picture
    on at

    @WFCH - Do you have any update if you manage to alter key?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard