Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

Add unique constraint to column in Dataverse Table

(0) ShareShare
ReportReport
Posted on by

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.

  • Hagru Profile Picture
    on at
    Re: Add unique constraint to column in Dataverse Table

    Perfect, thank you!

  • Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on at
    Re: Add unique constraint to column in Dataverse Table

    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
    on at
    Re: Add unique constraint to column in Dataverse Table

    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
    Re: Add unique constraint to column in Dataverse Table

    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
    on at
    Re: Add unique constraint to column in Dataverse Table

    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?

  • Verified answer
    Guido Preite Profile Picture
    1,488 Super User 2024 Season 1 on at
    Re: Add unique constraint to column in Dataverse Table

    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

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1

Featured topics