web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : K05XBifnqwE1taJiVWdpeb
Power Apps - Microsoft Dataverse
Unanswered

Clarify difference between key and primary field

Like (0) ShareShare
ReportReport
Posted on 14 Nov 2019 17:29:34 by 65

I'm trying to load some data into CDS and am not quite sure about the difference between the key field and the primary name field. E.g., I have a simple table with ID, First_name, Last_name. Would ID (whole number) be the key field and Last_name (text) be the primary name field? Does the primary name field have to be unique?

 

Thanks!

Categories:
  • kman42 Profile Picture
    65 on 21 Nov 2019 at 20:54:48
    Re: Clarify difference between key and primary field

    Is there a way to assign the GUID on import to CDS (using dataflows) to link tables that are related in the source? I can't figure out how to import related tables and maintain the relationships in a way that can be refreshed regularly (daily).

     

    Thanks!

  • David Jennaway Profile Picture
    716 on 19 Nov 2019 at 11:53:48
    Re: Clarify difference between key and primary field

    To add to the previous answers.

    The primary key field will be a guid, and will be auto-generated by CDS (though it is possible to specify the value if you create the data programmatically), it must be unique, and can't be changed

    The primary name field is a text field. By default this is a required field, but can be changed to non-required. Values do not need to be unique, though you can create duplicate detection rules to warn of duplicate values. If you want to generate a full name for the primary name, see https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/How-do-I-create-a-custom-entity-with-a-quot-full-name-quot/td-p/400345 for some ideas

    If you have a numeric field for an ID, you can create an autonumber field in CDS to give equivalent functionality to generate IDs, though note that autonumber fields in CDS are text fields, which allow you to apply formatting

  • v-monli-msft Profile Picture
    on 15 Nov 2019 at 08:19:05
    Re: Clarify difference between key and primary field

    Hi @kman42 ,

     

    To learn about alternate keys:

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/define-alternate-keys-entity

     

    And about primary field:

    By default, every entity contains a Primary Field, which is used by lookup fields when establishing relationships with other entities. Typically the primary field stores the name or primary description of the data stored in the entity. You may update the name and display name of the primary field before saving the entity for the first time.

    Also, observe that the primary field also has its own Name box, which functions similarly to the entity name described above. The primary field name is autopopulated when a display name is entered, uses the same prefix as the entity, and cannot be changed after the entity is created.

     

    More information about how to integration in CDS, please refer to:

    https://docs.microsoft.com/en-us/power-platform/admin/data-integrator

     

    Regards,

    Mona

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on 14 Nov 2019 at 18:22:26
    Re: Clarify difference between key and primary field

    Hi @kman42 

    The key should be unique.  Every entity must have a primary name field but does not have to be unique and it doesn't have to be required.  However, PowerApps will create a unique field (GUID) automatically when data is added. to an entity.  It uses this field for enforcing relationships.  

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Featured topics

Loading complete