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 Apps / Add unique constraint ...
Power Apps
Unanswered

Add unique constraint to column in Dataverse Table

(0) ShareShare
ReportReport
Posted on by 8

Hello!

 

I would like to add a Unique constraint to a custom column in my Contact table. The reason I want to do this is because they will have their own Customer ID coming from another system through an integration, and we don't want to create new contacts with the same Customer ID as another already existing Contact.

 

The custom field I would like to add this constraint to is a "Whole number", and I would like it to stay that way.

I have the same question (0)
  • Verified answer
    Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on at

    You just need to create an Alternate Key https://learn.microsoft.com/en-us/power-apps/maker/data-platform/define-alternate-keys-portal

     

    in this way you will not have duplicates in the column you defined as alternate key

  • Hagru Profile Picture
    8 on at

    Hi @GuidoPreite !

    So just by creating a new key, selecting the column, and give it a name, I will make a unique constraint to that column?

  • Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on at

    yes, that is the purpose of alternate keys, to ensure a set of fields (1 or more than 1) is unique, just as warning, make sure the column you are choosing for the alternate key doesn't have already duplicates or the alternate key will not be activated.

  • Hagru Profile Picture
    8 on at

    Perfect! Thank you very much, I will keep that in mind and check for already duplicate instances.

    One last thing, as it is not a required field, and a lot of the contacts won't have data in the field, will it stop me from creating multiple contacts with that field being empty?

  • Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on at

    empty is not considered a unique value for Alternate Keys, so you can have multiple rows with an empty value, but when filled they will be unique.

  • Hagru Profile Picture
    8 on at

    Perfect, thank you!

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard