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 Pages / Preventing Duplicate E...
Power Pages
Unanswered

Preventing Duplicate Email Addresses in Dataverse Contact Table

(0) ShareShare
ReportReport
Posted on by 21

Thanks to CHAT GPT I've nailed down my question. I'd be very grateful if someone can help me.


Requirement: Prevent Duplicate Email Addresses in Dataverse Contact Table

Objective:

Ensure that users can add a contact only if the email address does not already exist in the Dataverse Contact table. If a duplicate email address is detected, display an appropriate message to the user.

Details:

  • User Action:

    • The user interacts with a custom contact form placed on a Power Pages page.
    • Upon submitting the form, the system checks for duplicate email addresses.
  • System Behavior:

    • The system validates the entered email address against existing records in the Dataverse Contact table.
    • If the email address is unique, the system adds the new contact to the table.
    • If the email address already exists, the system displays a message on the page: “This user is already registered.”
  • Data Source:

    • Dataverse Contact table
    • Column: emailaddress1

Acceptance Criteria:

  1. When a user submits the contact form:
    • If the entered email address is unique (not found in the table), the system successfully adds the contact.
    • If the entered email address already exists in the table, the system displays the appropriate error message.

 

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

    if you don't want duplicates you need to create an Alternate Key https://learn.microsoft.com/en-us/power-apps/maker/data-platform/define-alternate-keys-portal

    keep in mind you must not have duplicates before otherwise the key cannot be enabled.

  • rfm1964 Profile Picture
    21 on at

    Thank you very much I'll look into this.

  • rfm1964 Profile Picture
    21 on at

    Is this suitable for Power Pages?

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

    Yes, Alternate Keys are a feature of Dataverse and Power Pages is based on Dataverse

  • rfm1964 Profile Picture
    21 on at

    OK. How would I show the alert on the power pages form?

  • EmadBeshai Profile Picture
    806 Moderator on at

    Hi @rfm1964 ,

    As @GuidoPreite  mentioned you need to use the alternative key, but you will not be able to control the error message since it will be the OOB error message.

     

    Another solution is to create email to validate if another contact exists on the system with the same email then throw your exception as needed.

     

    If this post helps you with your problem, please mark this answer as Accepted Solution.

    If you like my response, please give it a Thumbs Up. 

  • rfm1964 Profile Picture
    21 on at

    Using the alternate key works. But it displays a ugly message on the page. How can I display a custom message? TIA.

  • EmadBeshai Profile Picture
    806 Moderator on at

    Hi @rfm1964 ,

     

    As mentioned at my answer please use plugin if you want to add custom message.

     

    Unfortunately, the OOB message for alternative key is not customizable.

     

    If this post helps you with your problem, please mark this answer as Accepted Solution.

    If you like my response, please give it a Thumbs Up. 

     

  • rfm1964 Profile Picture
    21 on at

    How do I do that?

  • EmadBeshai Profile Picture
    806 Moderator on at

    Hi @rfm1964,

     

    This article shows you how you can create plugin step by step, but you have to be able to write C# code.

     

    https://d365demystified.com/2021/12/31/plugins-development-in-dynamics-365-crm-part-1-setting-up-visual-studio-project/https://d365demystified.com/2021/12/31/plugins-development-in-dynamics-365-crm-part-1-setting-up-visual-studio-project/ 

     

    If this post helps you with your problem, please mark this answer as Accepted Solution.

     

    If you like my response, please give it a Thumbs Up.

     

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 Pages

#1
Lucas001 Profile Picture

Lucas001 21 Super User 2026 Season 1

#2
Fubar Profile Picture

Fubar 19 Super User 2026 Season 1

#3
CN-06091549-0 Profile Picture

CN-06091549-0 18

Last 30 days Overall leaderboard