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 / CDS primary name field...
Power Apps
Unanswered

CDS primary name field data type auto number not generating auto number

(0) ShareShare
ReportReport
Posted on by
In Canvas app the CDS entity primary name field with auto number data type not generating an auto number. How to fix it so app can generate an auto number for each form record entry.
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @appdataac 

    Make sure to uncheck the required check box on the field properties fly out.  If you are importing data into the entity, it doesn't generate an autonumber at that time.  You will need to manually enter the sequence (using Excel) after the entity is populated. After that, new items added should have an autonumber generated by PowerApps.

  • Nhelgren Profile Picture
    on at

    Hello, The Primary Name field is limited to a string value only. It cannot be changed to be an autonumber field. However you can add an additional field for aotunumber that can be used on each entry.

  • ZachMitchell Profile Picture
    37 on at

    Is there further information on this?  I'm going through the Build the Dataverse table schema excercise in the Microsoft Learn Design an accident tracking app in Power Apps learning path, and it explicitly walks you through changing the primary field type to an autonumber.

    Here is a link to the MS documentation - Create Dataverse tables - Learn | Microsoft Docs

     

    https://docs.microsoft.com/en-us/learn/modules/build-dataverse-table-structure/2-create-dataverse-tables

     

     

     

  • Nhelgren Profile Picture
    on at

    Updated post: It appears some changes occurred on Autonumber since I last worked on it. I used strikethrough on my incorrect information and the updates are in italics. 

     

    Hi @ZachMitchell  my mistake, it can be set to an Autonumber after the fact, just not at creation. In order for Autonumber to generate the number you need to make sure the field it not set to "required" because autonumbers are generated during the save and you cannot save a blank required field. Then, do not include an editable field for the Autonumber field in your edit view of the form. If the field remains empty an Autonumber will be generated at the time of saving. It appears that now you can change the data type to autonumber. If you are having issues, perhaps wait for the rest of the required fields to be generated before making the change to see if that helps. Also Autonumber now generates even if it is set as required and you can no longer exit the Autonumber field. 

  • ZachMitchell Profile Picture
    37 on at

    I've tried it both as required and as optional.  I get the error the same both ways.  It should be mentioned though that the module on Microsoft Learn that I referenced does show that you are to leave it as Required.

  • Nhelgren Profile Picture
    on at

    It's interesting that it says to leave it as required, I anticipate that you will receive an error later trying to generate or save the record. I will try to find out who owns that content. It works fine for me on my instance. Try saving your table first and then changing it, that should also work. 

     

    Update: I was incorrect this now works as Required. 

     

    I tried it by changing on table create and it also worked as expected for me.

  • ZachMitchell Profile Picture
    37 on at

    So after testing it multiple times before posting, then at least a couple of times afterwards to troubleshoot based on the responses I'd received, I was still getting the error.  Yesterday though - I tested once more to demonstrate the behavior to a co-worker working in the same environment...and it worked.  The primary field was able to be changed to an autonumber, and did save successfully.

    I do not believe I did anything different.  I went through and tested again a couple of times, once even following the screenshots I had posted.  It has worked every time since.  

     

    At this point I'm going to write it off as a bug that has been corrected.  Not sure that will help anyone else that experiences this issue - but maybe try it again in a couple of days.

     

    Thanks everyone for the responses.

  • Nhelgren Profile Picture
    on at

    Glad it is working now Zach. I am unaware of any bug fixes deployed that would impact this but I am glad it is working now. Let me know if you see it pop back up again. 

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard