cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndKanPA
Resolver I
Resolver I

Unique attribute value

Hello community,

 

is it possible to define an attribute as "must-unique", similar to SQL unique index?
This would be neccesary i.e. for order-numbers.

User enters this value in a form manually (auto number ist not an option in my case), but it dont have to be double.

 

If such a unique-feature is not supported by default, how can it be implemented?
Any ideas?

 

Thanks for help,

AndKan.

 

4 REPLIES 4
Fubar
Solution Sage
Solution Sage

When you are editing the definition of the Entity/Table their is a Keys tab, this Keys feature will enforce unique (as long as the value provided is not null).  Basically, you create a key that contains the Column/Field that the user is going to type into, make that field mandatory to force the user to provide a value (a null will save but not trigger the unique rule).

Hello @Fubar ,

what's about: https://docs.microsoft.com/en-us/power-platform/admin/set-up-duplicate-detection-rules-keep-data-cle... and 

Table settingsTable settings

In my case it didnt work 😞 Or I done something wrong.
Users was able to enter duplicate values.

My solution is now a little AJAX request, which checks the entered value aganist table/column.

 

Thanks,

AndKan.

 

Fubar
Solution Sage
Solution Sage

Duplicate Detection applies duplicate detection rules and warns the user that they may be creating a duplicate record when one of the rules is true - but the user is allowed to continue and ignore and save i.e. save a duplicate if they decide to (they can also act when data importing depending on what settings are set when doing the import).

That setting in your screen shot just enables that entity for duplicate detection, you also have to turn Duplicate Detection on, and configure Duplicate Detection Rules (there are a few rules provided by Microsoft on several key entities - but others you need to create).  in the PowerApps interface you would need to use admin.powerplatform select your environment and go to Settings and then Data Management.

Hi @AndKanPA,

Duplicate detection mainly provides alerts to users that duplicate data may exists before creating or updating records. It won't necessity stop you from having duplicate data. Alternate keys is the way to go as @Fubar suggested, more info on alt keys: https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/define-alternate-keys-portal

Note depending on how much records you have it may take time for your key(s) to activate as the system has to index the records. You cannot view the status of the alt key in make.powerapps.com but can in the classic solution explorer.

Hope this helps

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (4,317)