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 Apps / a record with matching...
Power Apps
Suggested Answer

a record with matching key values already exists

(2) ShareShare
ReportReport
Posted on by 21
Hello everyone,
 
I'm building a power app with dataverse.
I would like to have a table with a composite primary key using two columns (trx_id and user_id).
 
In my table (app_trx_header) I've created a key that uses the two business required columns stated above.
 
 
It looks that check done by the system while I'm inserting data in the table is looking only at trx_id column giving me a generic error
 
 
Don't understand what's wrong here.
Tried to create a test table and it works as expected. Also the error is more clear in case of duplicate key:
 
 
What could I check?! I'm quite confuse...can it be that the table has been corrupted on indexing/primary key side?
 
Thanks in advance for helping me.
Marco
 
 
I have the same question (0)
  • ronaldwalcott Profile Picture
    3,862 Moderator on at
    Did you mention what the primary column of the first table was?
  • MarcoBalduini Profile Picture
    21 on at
    Hi  , ronaldwalcott thanks for your answer!
     
    The primary column of app_trx_header is trx_id.
     
    But I saw empirically with some tests and from MS manuals that primary column has no impact on primary keys.
    I see that in this specific case it looks that power apps is using this column as primary key
     
  • ronaldwalcott Profile Picture
    3,862 Moderator on at
    Do you have Apply duplicate detection rules turned on and is the primary column set to business required?
  • MarcoBalduini Profile Picture
    21 on at
    Hi again Ronald,
     
    quite new to power apps and dataverse; if the "dupolicate detection rules" is the below we don't have rules. 
    No particular setup has been done here
     
     
    and yes, the primary column is set as business required.
    Thanks, Marco
  • ronaldwalcott Profile Picture
    3,862 Moderator on at
    This dialog determines if it is on
     
    which you see when you choose the properties option on the table
     
     
    Try adding a duplicate trx_id value in Dataverse to see if it gives you a duplicate error message 
  • MarcoBalduini Profile Picture
    21 on at
    Hi Ronald,
     
    it looks the option is active but I think it refers to the below standard rules and there is no rule for my custom table.
     
    I've also tried to disable the option but the behaviour is stil the same: if I enter a double trx_id I get the error this happens with or without the "apply duplicate detection rules option". Maybe the issue is not related to this option... :( 
     
  • ronaldwalcott Profile Picture
    3,862 Moderator on at
    Are the two key values numeric or is user_id a GUID?
  • MarcoBalduini Profile Picture
    21 on at
    Both columns trx_id and user_id have this setup (no GUID has been used here) :
     

  • Suggested answer
    ronaldwalcott Profile Picture
    3,862 Moderator on at
    I have tested and found that when a composite key is created using the primary column field the table will treat the primary column as a unique key. If a composite key is created using other columns the resulting composite key will behave as expected.
     
    Please confirm.
  • Ram Prakash Duraisamy Profile Picture
    5,699 Super User 2026 Season 1 on at
    Hi,
     
    Make sure what is the KEY Provided here.
     
    what ever the key which we used here cannot have duplicate values
     
     


    Please mark as answer if my suggestion helps.
    Subscribe here for More Useful videos : https://www.youtube.com/@rampprakash3991

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 Apps

#1
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard