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?
Thanks for help,
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 ,
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.
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.
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
Check out new user group experience and if you are a leader please create your group
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.