Using the AutoNumber Field Type in PowerApps and Dynamics 365

Leave a comment

In PowerApps, Dynamics 365 and the Common Data Service, we have the option to use a field type called AutoNumber, which automatically updates the data in the field to a set format and increments a number in the field. Let’s look at how to do this.

Log into PowerApps at https://powerapps.microsoft.com/en-us/ and select your PowerApps environment:

Let’s add an autonumber field to our Account entity. Go to Data->Entities and select the Account entity:

Click Add field:

You will see the pane open:

Clicking on the Data Type field gives us options for setting the data type, including Autonumber:

Enter a Display Name for the field. We can see in expanding the Autonumber type, we have String prefixed number, date prefixed number and custom:

Let’s use String Prefixed and enter TEST- as the prefix. The Seed value is the starting number that will be incremented. So in our case, our field looks like TEST–1000, TEST–1001 etc:

Advanced Options allow us to set the Description, Max Length and IME Mode (for international characters):

If we decided to use a Date Prefix, we would get something like below, with the option to choose the date format:

And with the Custom format, we can define our own format (see more for defining these):

We will continue with the Text format example. Click OK to save the field.

In the bottom right click Save Entity.

The field is now created. Let’s use it on a form:

Go to Forms and select the Account Main form:

Drag the field onto the form:

In the top right, Save and Publish:

Now, open an App and navigate to the Account form. We see the new field. Enter an Account Name and click Save:

Save the record, and the autonumber field will increment:

 

 

ABOUT CARL DE SOUZA

Carl de Souza is a developer and architect focusing on Microsoft Dynamics 365, Power BI, Azure, and AI.

carldesouza.comLinkedIn Twitter | YouTube

 

Leave a Reply

Your email address will not be published. Required fields are marked *