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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Name of a "Primary Nam...
Power Apps
Unanswered

Name of a "Primary Name" Column

(0) ShareShare
ReportReport
Posted on by 41

 Hi Experts,

 

on a custom table we can choose the name we want to use for our primary name column. How can I found out what is the name of primary column given the table name? so e.g. , where can I check, that "Full Name" is the primary column name of the contacts table...

[Upd]: I want to know the name "programmatically" - check einther in a flow, through a OData query, etc.

 

Bothered me for several days now and I cant find it with my search skills.

 

Thanks! 

I have the same question (0)
  • gulshankhurana Profile Picture
    1,397 Moderator on at

    Hi @MetroIgor 

     

    You can find it in the properties of that table. Example screenshots below:

     

     
     Screenshot at Jul 28 15-06-16.png

    Screenshot at Jul 28 15-05-34.png

     

     

    Screenshot at Jul 28 15-08-28.png

    If you like my response then please give me a thumbs up and if it helps answer your query then please accept it as a solution.

     

    Kind regards

     

    Gulshan

  • ID-27081604-0 Profile Picture
    41 on at

    Many thanks for replying @gulshankhurana .

    I obviously forgot to mention, I want to know the name "programmatically" - check either in a flow, through a OData query, etc. (updated original post)

    So, I know my entity name and look up in some table, what is the name of the primary column. Like e.g. in the table 'entites' I look up the localised name of the collection.

     

    Thanks!

  • gulshankhurana Profile Picture
    1,397 Moderator on at

    Hi @MetroIgor 

     

    I'm not a programmer but I think you may find the info in the following link useful:

    Table definitions in Microsoft Dataverse - Power Apps | Microsoft Learn

     

    Primary name

    The PrimaryNameAttribute property value is the logical name of the column that stores the string value that identifies the table record. This is the value that will be displayed in a link to open the record in a UI.

    Example: The Contact table uses the fullname column as the primary name column.

     Note:

    Not every table will have a primary name. Some tables are not intended to be displayed in a UI.

     

    Kind regards

    Gulsan

  • steeevid Profile Picture
    323 Super User 2024 Season 1 on at

    That will be the logical name and you can look this up from the primary name field. 

     

    For example, something like a <publisher_prefix>_primaryname

    new_invoicenumber

     

    However primary by default is not unique, if you want to find the GUID of the field it's from a column call unique identifier, which you can find it from the list of columns.

     

    Also please note that in oData quart, lookup field will be name something like _cr35r4_primarynamw_value

  • ID-27081604-0 Profile Picture
    41 on at

    Thanks, @Stevieed. I am aware of the prefix. 

    You are writing "That will be the logical name and you can look this up from the primary name field." - my problem is exactly how to find out (with code), what is the user given name for the primary field. 

  • ID-27081604-0 Profile Picture
    41 on at

    Thanks, @gulshankhurana. I am aware of this article. Unfortunately, it doesn't tell me, how to identify, whether a column is primary or not. But, as you showed in the screenshots, somehow Datavrse knows this...

  • steeevid Profile Picture
    323 Super User 2024 Season 1 on at

    to find which column is primary name and which column is unique identifier:

    Stevieed_0-1690708894935.png

     

    to get the logical name of the column you want and reference it in an OData expression:

    Stevieed_1-1690708982997.png

     

     

  • ID-27081604-0 Profile Picture
    41 on at

    Hi @Stevieed, thanks for prompt response! I realise, I am not describing well enough my problem - apologies and bear with me, please.

    Imagine, I have a custom table called "my_table" with a primary name column named "my_primary_name_column". 

    If I call a custom page, I can only hand over as a parameter "redord_ID" and "entity_name" (https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/navigate-to-custom-page-examples#open-as-an-inline-full-page-with-a-record-context).

    So, I know, I am looking at "my_table" and know unique identifier of the record. BUT, I still dont know the name of my primary column to show something useful to the user.

    Hope it makes it clearer....

  • steeevid Profile Picture
    323 Super User 2024 Season 1 on at

    @MetroIgor 

    I see, for this, you need to install "level up for Power Apps" plugin from Chrome Store, when open a type of record that you want to refer to, click on the plugin in the browser, select "show all field":

     

    Stevieed_0-1690713098104.png

     

    then the lookup field which contains the GUID, the display name, will be shown as something like below:

    Stevieed_1-1690713243794.png

     

    Then you can refer it in the javascript code directly by copy the name:

    Stevieed_2-1690713315093.png

     

  • Fubar Profile Picture
    8,344 Super User 2025 Season 2 on at

    The name of the field will be in the "PrimaryNameAttribute" which is a Property of the Entity (Table) Metadata

    https://learn.microsoft.com/en-us/dotnet/api/microsoft.xrm.sdk.metadata.entitymetadata?view=dataverse-sdk-latest

     

    Not sure if it is exposed via JavaScript or not, but is in C#.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard