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 / New model-driven app /...
Power Apps
Answered

New model-driven app / How to not let the user add a duplicate value in the primary column?

(0) ShareShare
ReportReport
Posted on by 286

Hello team,

Newbie here with PowerApps. Your help will be much appreciated.

 

Now, I've created a new Standard table in the Database called 'Products'. It has two columns: 'Product Name' and 'Category Name'. The first is also the primary column. PowerApps has then added a lot of other columns, including the Primary Identification Key one.

 

I've then created a Model-Driven app, in which I added the two columns. The user can change an existing line or add a new one.

 

My problem is that a user can add the same 'Product Name' in two different lines. Is there a way to stop that, please?

 

Thank you,

 

Alice

Categories:
I have the same question (0)
  • narayan225 Profile Picture
    2,547 Moderator on at

    @AliceW 

     

    You can add a duplicate detection rule to make sure that the users don't create two Products with same name.

    https://learn.microsoft.com/en-us/power-platform/admin/set-up-duplicate-detection-rules-keep-data-clean

     

    Cheers!

  • AliceW Profile Picture
    286 on at

    Thank you - checking now, Narayan.

  • AliceW Profile Picture
    286 on at

    It works, BUT it lets users bypass the rule!

    Like, I added the same product, clicked on Save & Close, got a warning pop-up about the duplicate - so far, so good.

    However, in the pop-up you have TWO buttons: you can go ahead and create the duplicate or cancel.

    It's crazy, right? They should not be allowed save a duplicate.

  • Verified answer
    narayan225 Profile Picture
    2,547 Moderator on at

    @AliceW 

     

    You can setup alternate keys to that column to prevent record creation altogether.

    https://learn.microsoft.com/en-us/power-apps/maker/data-platform/define-alternate-keys-portal

     

    This should solve your problem.

     

    Cheers!

  • AliceW Profile Picture
    286 on at

    A huge thanks, Narayan!!! You're a life saver.

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
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard