When creating a table in dataverse, the column "Name" was generated automatically as autonumber.
Now, I'm surprised that when entering data into this "Name" column with a form in Power Apps, it allows for duplicates!
What is the best praxis to prevent duplicates in a Name column, other than adding an alternate key, when submitting data through a Power Apps form?
In the form there is no "Update" property for the "Name" field.
Hi @WebPortal ,
Instead of enforcing restrictions on PowerApps, I'll suggest you try Duplicate Detection Rules in Dataverse/CRM for the table including the columns you want to keep it unique.
Another way is, if trying from PowerApps then find the value before performing SubmitForm or Patch operation. This will keep duplicates away most of the time, it may fail only is there's very large amount of data after filteration.
Although, you can also hide the field on PowerApps form so users do not enter value in it or keep read-only on PowerApps level.
Lastly, Plugins is a solution but I think above solutions could help you prevent duplicates.
Hope this helps
This is happening again, and I'm getting crazy.
I have an alternate key that prevents the duplicates, but when users try to submit a new entry through a Power Apps Form, they see the marvelous message:
"Network error when using Patch function. Value must be between 0 and 100."
Which is completely stupid.
The error is caused because a duplicate entry on the primary column is happening and the alternate key does not let it in.
On the form, there is no "Update" property for this field, so I can't even find the maximum value and add 1.
How can I fix this? I don't know how to make the field "read only" nor how to create plugins.
On the forms that are being used make the field readonly. (in the old days these used to be readonly by default but was changed a number of years ago to allow them to be editable)
@WebPortal wrote:
The whole point here is why is it allowing duplicates?
It seems to be correctly configured.
The sequence number of the Autonumber is maintained by the system but not in the table that you have set it for. It does not look at any existing value that may be stored in your table when it generates the next number, just gets the next number from the system.
The Autonumber is then populated in a text field, after which you can edit it.
You can also get duplicates if you change the seed value in the autonumber definition to a number that is lower or the same as one that has already been generated.
To guarantee uniqueness, you create an Alternate Key,
To warn users who may still then choose to progress you create a Duplicate Detection Rule
To stop someone editing the value you either don't have the field on the form (if its the Primary Name column you can make that field not business required and then remove it from the form) or make it readonly on the form.
Hello,
This is the field definition:
The whole point here is why is it allowing duplicates?
It seems to be correctly configured.
Wait @WebPortal ,
Isn't AutoNumber field read-only? If not, prevent from editing by making field read-only so system can generate auto number on its own.
It's strange that you can edit those and have duplicates.
Also, as @a33ik said Duplicate Detection rules can be used for instant validation without using Plugins.
Alternatively, Plugins work as good as detection rules when used in sync mode. Plugin is beneficial for generating custom auto-number.
Another way (may not be as great) while you are saving record in powerapps, check for that number and if duplicate then stop creating record else create.
Hope this helps
That's correct. Then there are a few things you can consider:
Sure, but if it is autonumber, the user has no way of choosing a different number.
I don't see the point of this column and don't understand what it is meant for.
Ok, then the only way I see doable - allow to create the record but mark it as duplicate or do a check before the record is created and notify a user about the potential duplicate.
It's not an option because when a user submits the form, sees an error message (the AK blocks the duplicates) and the record doesn't go through.
Hello,
Just curious why Alternate Key is not an option for you. If not Alternate Key you would have to create a Plugin to avoid Duplicates.
SadFox
2
CU06052020-0
2
stampcoin
2