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 / Avoid duplicates in Na...
Power Apps
Unanswered

Avoid duplicates in Name column Dataverse

(0) ShareShare
ReportReport
Posted on by 2,297

When creating a table in dataverse, the column "Name" was generated automatically as autonumber.

 

Now, I'm surprised that when entering data into this "Name" column with a form in Power Apps, it allows for duplicates!

 

What is the best praxis to prevent duplicates in a Name column, other than adding an alternate key, when submitting data through a Power Apps form?

 

In the form there is no "Update" property for the "Name" field.

I have the same question (0)
  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello,

    Just curious why Alternate Key is not an option for you. If not Alternate Key you would have to create a Plugin to avoid Duplicates.

  • WebPortal Profile Picture
    2,297 on at

    @a33ik 

    It's not an option because when a user submits the form, sees an error message (the AK blocks the duplicates) and the record doesn't go through.

  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Ok, then the only way I see doable - allow to create the record but mark it as duplicate or do a check before the record is created and notify a user about the potential duplicate.

  • WebPortal Profile Picture
    2,297 on at

    Sure, but if it is autonumber, the user has no way of choosing a different number.

    I don't see the point of this column and don't understand what it is meant for.

  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    That's correct. Then there are a few things you can consider:

    1. Create a Duplicate Detection Rule and Periodically run a Duplicate Detection Job to find those duplicates (that's weird that those even appear, actually it shouldn't happen - I would recommend checking how it's even possible). Here are a few articles about duplicate detection - https://learn.microsoft.com/en-us/power-platform/admin/set-up-duplicate-detection-rules-keep-data-clean and https://learn.microsoft.com/en-us/power-platform/admin/run-bulk-system-jobs-detect-duplicate-records
    2. You can tweak autonumber format to add a random string to the generated number to make it unique - https://learn.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/create-auto-number-attributes?view=op-9-1#autonumberformat-options
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Wait @WebPortal ,

     

    Isn't AutoNumber field read-only? If not, prevent from editing by making field read-only so system can generate auto number on its own.

    It's strange that you can edit those and have duplicates.

     

    Also, as @a33ik  said Duplicate Detection rules can be used for instant validation without using Plugins.

    Alternatively, Plugins work as good as detection rules when used in sync mode. Plugin is beneficial for generating custom auto-number.

    Another way (may not be as great) while you are saving record in powerapps, check for that number and if duplicate then stop creating record else create.

     

     

    Hope this helps 

     

  • WebPortal Profile Picture
    2,297 on at

    Hello,

     

    This is the field definition:

    WebPortal_0-1706378930928.png

     

    WebPortal_1-1706378949544.png

     

     

    WebPortal_2-1706378999295.png

     

     

    The whole point here is why is it allowing duplicates?

     

    It seems to be correctly configured.

  • Fubar Profile Picture
    8,501 Super User 2026 Season 1 on at

    On the forms that are being used make the field readonly. (in the old days these used to be readonly by default but was changed a number of years ago to allow them to be editable)

     


    @WebPortal wrote:

     

    The whole point here is why is it allowing duplicates?

     

    It seems to be correctly configured.


    The sequence number of the Autonumber is maintained by the system but not in the table that you have set it for. It does not look at any existing value that may be stored in your table when it generates the next number, just gets the next number from the system.

    The Autonumber is then populated in a text field, after which you can edit it.

    You can also get duplicates if you change the seed value in the autonumber definition to a number that is lower or the same as one that has already been generated.

    To guarantee uniqueness, you create an Alternate Key,

    To warn users who may still then choose to progress you create a Duplicate Detection Rule

    To stop someone editing the value you either don't have the field on the form (if its the Primary Name column you can make that field not business required and then remove it from the form) or make it readonly on the form.

     

     

     

  • WebPortal Profile Picture
    2,297 on at

    Hello @Fubar @Ethan_R @a33ik 

     

    This is happening again, and I'm getting crazy.

     

    I have an alternate key that prevents the duplicates, but when users try to submit a new entry through a Power Apps Form, they see the marvelous message:

     

    "Network error when using Patch function. Value must be between 0 and 100." 

     

    Which is completely stupid.

     

    The error is caused because a duplicate entry on the primary column is happening and the alternate key does not let it in.

     

    On the form, there is no "Update" property for this field, so I can't even find the maximum value and add 1.

     

    How can I fix this? I don't know how to make the field "read only" nor how to create plugins.

  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @WebPortal ,

     

    Instead of enforcing restrictions on PowerApps, I'll suggest you try Duplicate Detection Rules in Dataverse/CRM for the table including the columns you want to keep it unique. 

    Another way is, if trying from PowerApps then find the value before performing SubmitForm or Patch operation. This will keep duplicates away most of the time, it may fail only is there's very large amount of data after filteration.

     

    Although, you can also hide the field on PowerApps form so users do not enter value in it or keep read-only on PowerApps level. 

    Lastly, Plugins is a solution but I think above solutions could help you prevent duplicates.

     

    Hope this helps

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 387

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 301

Last 30 days Overall leaderboard