Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

Dataverse id column



I have a problem with the allocation of the unique ID in the Dataverse. I tested two options:


1. The ID column is set to Text and while the new record is added it's working throught the following function:


Patch(Aufgaben; Defaults(Aufgaben); {cr123_id:First(Sort(Aufgaben;cr4f5_id;Descending)).cr4f5_id+1}; the rest of the to be patched fields)


In this case I am able to add only 10 records with uniqe ID number. After 10 records the function First(Sort(Aufgaben;cr4f5_id;Descending)).cr4f5_id shows always that the last record has ID 9. All new records will be saved with the ID number 10. So nevermind how many records I will add, it will always be saved with ID number 10. 


2. The ID column is set to autonumber. The field is set to optional. I am patching with the patch function and no cr123_id field inside. All new records will be patched with double id numbers. So now I have two records with id number 1, two records with id number 2, two records with id number 3, etc.


What is the problem over here? In the whole application I am using text format for the id columns in all other tables and the function {cr123_id:First(Sort(Aufgaben;cr4f5_id;Descending)).cr4f5_id+1} is working on all other tables except the table Aufgaben.

Helper I
Helper I

Okay so I managed to do some small workaround and used ClearCollect to collect the table (otherwise you get delegation warning) and the function Max(colTable; id) +1 to get the max number from the id field and set the new one +1. 


I still don't understand why the autonumber doesn't function properly "out of the box". Is it normal?

Super User
Super User

HI @maskwer ,


Utilizing autonumber, you should not set this field at all in your patch.  Make sure the field is setup as "Not Required" in the Dataverse and the field will be set by Dataverse utilizing the pattern identified when you configured the autonumber field when you add a record.  You do not need to to the Max(...) + 1 type of logic. 


Hope this helps.  Please accept if answers your question or Like if helps in any way.



Hope this helps. Please accept if answers your question or Like if helps in any way.
Super User
Super User

Hello @maskwer,


1. If you are using text field then you are good to go with cr4f5_id+1 and you can patch the same too.

2. If you are using Auto Number Field then you don't want to worry about setting the field using Patch Function try setting the AutoNumber field in the Dataverse Table Level.


1. Go to

2. Click On DataVerse

3. Click On Tables

4. Expand Table and Click Aufgaben

5. Click On Fields 

6. Open the Auto Number Fields then set the Auto Number Type





then you can input Seed too to proceed the same.



Please mark as Answer if it is helpful and provide Kudos

Subscribe :
Blog :

Helpful resources

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (4,854)