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 / duplicate prevention b...
Power Apps
Answered

duplicate prevention based on multiple validations

(0) ShareShare
ReportReport
Posted on by 65

could anyone support me with the following requirement?

in model-driven app, I need to add a validation on a field (account) to make sure that it's not duplicated for the same selected value for other field (bank)

lets say we have bank A and bank B, I selected bank A and in account field I choose ACCOUNT-A, the app must get all the records on this table that has bank value A and check if any of these record has account value as ACCOUNT-A, if there's no match then same, else show error message

 

I've found JS code to make the first part duplicate account prevention descripted in this link,

but i cant add the other bank validation, could you please help me on this?

I have the same question (0)
  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @mohanade,

    Not sure I understand exactly the validation required, but it is possible to share your current code to help? You can have JS (frontend) or plugins (service-side) logic to validate. Depends if you would like this validation to be executed in other scenarios (eg integration or data import). Cheers

     

  • Verified answer
    thomasfnorthrup Profile Picture
    252 on at

    Hi, thanks for reaching out. You can certainly use custom code to accomplish this. The JS would give an error to the user as they change the field. However, I believe you can solve this with the OOTB duplicate detection rules. These trigger on save and will validate if a field is unique across all other records of that type. 

    To use these navigate to Advanced Settings > Data Management > Duplicate Detection Rules. There you can create a new rule and set it to validate off the field you want to be unique across all other records of the same type. 

    Good Luck! 

  • Verified answer
    EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    If I understand the dedup rules trying to do I don't think it would work because it has to retrieve child records and validate against those. But it's true that out-of-the-box duplicate detection rules is a great feature!

  • mohanade Profile Picture
    65 on at

    thank you guys, it works

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 955

#2
11manish Profile Picture

11manish 652

#3
Valantis Profile Picture

Valantis 626

Last 30 days Overall leaderboard