Hi everybody,
In the dataverse, i have a table that uses an autonumber column as primary name column. It worked fine until now.
If I add a new value, I always get this error:
A record that has the attribute values id already exists. The entity key idkey requires that this set of attributes contains unique values.
If I add a new item and fill in the autonumber column (id) manually with a nonexisting number, it works fine.
Thanks for the update @albatros.
I recently came across a similar situation. All along I was creating records using a canvas app. Then when I used a Flow to create records, it decided to start from the default value of the autonumber column. Of course those values were already taken so it errored out. What I discovered is that if you use the Dataverse action "Add new row for a selected environment", the Flow resumes from the last autonumber.
Hopefully this helps anyone with the same situation.
I had the same issue and this helped me.
For some reason, when I migrated my solution to another environment including the table definition, the seed for my column was reverted to the default value (1000), instead of the value that I've picked originally (1). In my case, this was causing a duplicated ID issue because the id 1000 existed already (I kept IDs 1-31 free for testing purposes).
Hope this can help others too.
The "id" column is the key column. It looks like autonumber reset the next value to a random number. In this case, the next number was 1153, however, I've had elements with id already in 1190. So I put a new seed value in it and now it works again. I can continue working but I still don't know what caused the problem so that's a pity.
Hi @Olav ,
You still have not answered my question.
Please tell me to troubleshoot the problem.
Have you created an Alternate Key?
Best Regards,
Wearsky
Not sure what has gone wrong etc, but you probably need to look at your existing data and find the current largest one in the name field, and then on the autonumber definition reset the Seed value higher than that number.
As it appears you are allowing data entry into the field it is possible that a number was manually added (or imported) that the autonumber sequence is now also generating the same number and your Alt Key has a uniqueness issue as you now have a duplicate.
(note: autonumber does not look at the current entity for the next number, the actual sequence is held elsewhere)
Thank you for looking at my question.
So, I have a table: "ExampleTable". This has a primary name column: "Id" with type autonumber. So each time the user adds a new record, the system should assign automatically the next number. "Id" is the selected column under keys.
Doesn't work:
Patch(ExampleTable, Defaults(ExampleTable));
Does work (assuming 123 isn't in the table yet):
Patch(ExampleTable, Defaults(ExampleTable), {Id: 123});
Hi @Olav ,
To make it easier to understand, please check this section.
Its function is to prohibit adding records with duplicate values.
If you want to add records with duplicate values, I suggest you delete the key.
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Hi @Olav ,
Could you use pictures or some formulas to describe the problem you encountered?
Have you created an Alternate Key for the table?
Best Regards,
Wearsky
stampcoin
15
ankit_singhal
11
Super User 2025 Season 1
mmbr1606
9
Super User 2025 Season 1