I'm wondering if those with more experience can offer me some guidance.
I have a custom "contact" entity, which, up till now, I have been designing with the full name + state as the primary key (eg. john smith illinois). However, it's becoming apparent that I'm not going to be able to keep the primary field unique.
What is the best way to navigate this? My thoughts are:
1) I could add more data (eg. full name + address + state) to make it unique...
2) Or I could re-format the entity so that the primary field is an autonumber
If I went with 1), it seems a klunky way to design the entity. I'd love to know what others do instead.
If I went with 2), I'm worried that when I design my powerapp (model driven), if the primary key is a number, am I going to have difficulty populating the record search box with name/address/state autofill suggestions eg. if someone types in "John", I would like the suggestion drop down to show all the Johns, together with their address & state, so the user can select the right one.
Any guidance would be hugely appreciated, thx!
Hi @Madumi ，
Do you want to deal with the problem of primary field unique?
I think the second way that you listed is better.
As the searching function, you just need to search based on Name field, not primary field.
What's more, you could also consider use GUID field as primary field, which will always be .
Here's a blog about how to work with this kind of data for your reference:
Thanks so much Phoebe,
So if I understand you correctly, when I create my model driven powerapp, even when using autonumbers for primary keys, I can still create a search function on the name field to retrieve rows which will autofill the search results? i.e. if I typed "john," in the search box, I could still have john agnes, john brown, john campbell, etc, drop down for the user to select?
Can anyone guide me...
When creating a new Entity, the Primary Field is officially described as the field which "will be shown to users when they need to select from a list of records."
So... If I use an autonumber instead of the user friendly text field, when I create a powerapp, am I going to be stuck with the unintelligible autonumber field in search results, or will I be able to populate the search results with a meaningful list of (text) records i.e. populating it from the other fields?
Or should I simply ensure that the primary field remains both unique as well as user friendly (text based)?
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.