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 / How to display error m...
Power Apps
Unanswered

How to display error message if value already exist?

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have a CDS Entity having Primary Name Field called "Item ID" which is bound with Edit Form control.

 

I want to display an error message, if duplicate field is found already in the entity.

 

which formula I can use to identify whether value is unique or not?

 

Thanks,

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Follow this Post;

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Check-if-record-exist/td-p/377121

     

    If you have issues give a feedback of your code

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Filipe Relvas Profile Picture
    Microsoft Employee on at

    Hello Dave,

     

    Please correct me if I'm wrong but if I understood you correctly you want to display a message when you submit the form stating the Field in question is duplicated and prevent a record create / update from happening, correct?

     

    I believe you have two distinct options here:

     

    Server Side:

    Since these records will be kept in a CDS / Dynamics environment you can create an Alternate Key which will throw an error based on the Field of your choice if it detects a duplicate. The CDS connector while making the submission to the Datasource will then show a similar error to this one:
    FilipeRelvas_2-1600692513848.png

     

    Documentation:

    https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/define-alternate-keys-portal

     

    Note:

    Please note that if you already have duplicates in the system, make sure you resolve them before creating the Alternate Key otherwise it won't work as the System Job that will create will fail.

     

     

    Client Side:

    You can also perform a check before submitting the form by performing a request against the Data Source and looking for any records with that same Field Value. You can use the Lookup() function to do so.

     

    Example: 

    LookUp(Accounts, 'Account Name' = DataCardValue.Text) --> This will return the first record that meets the condition. Which means that if a record is returned a duplicate exists and you should Notify the user and abort or prevent the form submission.

     

    Hope this helps 🙂

     

    Filipe Relvas.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard