Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Unanswered

Change the Primary Key in a Microsoft Dataverse table?

(1) ShareShare
ReportReport
Posted on by 6

How do you change the primary key in a MicroSoft Dataverse table created in Teams?

Categories:
  • MichaelFP Profile Picture
    1,831 Super User 2025 Season 1 on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    @JonathanDavey1  No always will be a free text field. What you can do it is get the value from another field and apply into the primary field. In that case will always show the information in the lookup column of other table.

     

    If my answer helped you, please give me a thumbs up (👍). If solve your question please mark as solution ✔️. This is help the community.

  • lefranz Profile Picture
    3 on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    I want to populate the Primary Name with the a combination of two fields, like First Name and Last Name. How would a business rule look for this? Can I make a rule on table level, that always corrects the Primary Name field when there is a change in First or Last Name, or do I need to write a business process for each form. That it interacts with? How would this look in a canvas app?

     

  • cordycep Profile Picture
    76 on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    THANKS

  • Nhelgren Profile Picture
    on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    This can be done within your app. If you are using a Canvas app, you can create blank fields to display the data, and then use a formula such as "<<lookup column>>.selected.<<desired column>>" In your case say your lookup column in Purchase was called "IngredientName", you would have a blank field named "Unit", your formula on the Unit field would be IngredientName.selected.Unit.

     

    If you are using a Model Driven app you would need to build an Automate flow that would trigger off of your lookup, and retrieve the values you wanted and populate them into your fields. 

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    i have 2 tables , table 1 named as "ingredients" and table 2 is "purchase"....ingredients table is my primary table which contain "ingredient name(primary column)","quantity", "unit"(column names)...purchase table get values from ingredients table by look up .but values of  the primary column of ingredients table is only  getting as lookup , i want values from "quantity" column and "unit" column ..how can i get it ?

  • Nhelgren Profile Picture
    on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    I'm afraid this cannot be changed, currently the default column used for lookups is always the Primary Name column. 

  • Gowri Halan Profile Picture
    262 on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    @JonathanDavey1 If you want it to make readonly. you have that option on form. See below step.

    1. Open the entity form (form name - main/name of your form)

    gowrihalan04_0-1669285948071.png

    2. You can mark this property so that user cant edit it manually/ Or simply hide this field. Add your custom field below on it and make it editable.

    3. Now in You pre-Create Plugin copy the custom field value to Name field.

    4. Now your custom value gets copied to Name field and same will reflect in the lookup.

     

  • JonathanDavey1 Profile Picture
    69 on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    My error, yes Primary Column can be set to OPTIONAL in EDIT Column. But not EDIT Table.

  • Fubar Profile Picture
    7,892 Super User 2025 Season 1 on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    @JonathanDavey1 wrote:

    Is it possible to use a different column as the Primary Name column that appears in Lookup choices?

    No

    The challenge is what users enter TEXT into the Primary Name Column.  Especially if it's a default REQUIRED column (in Teams).

    In the field/column definition you can set it optional.

    On the Form definition you can set it readonly (or by form Business Rule). 

     

    If you want it to be readonly and required then as suggested by another poster you can populate it via a "Pre" Plugin.  If readonly and optional you can do via Pre/Post Plugin or (post) Workflow, or potentially Server-side Business Rule.

     

  • Gowri Halan Profile Picture
    262 on at
    Re: Change the Primary Key in a Microsoft Dataverse table?

    @JonathanDavey1 You have work around for your scenario. You can make primary name field as locked. Use a Business rule or pre create plugin to populate this field using the desiered value you want. Note that this field is marked as business required, but you can change that setting to optional.

     

    Currently you cannot make another field visible in the related entity lookup. but can do above work around.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Microsoft Dataverse

#1
mmbr1606 Profile Picture

mmbr1606 22 Super User 2025 Season 1

#2
stampcoin Profile Picture

stampcoin 17

#3
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

Overall leaderboard

Featured topics