User Review
( votes)Back in the old days, we had to write custom plugins to auto-generate code values to automatically assign sequential numbers to records being created.
To overcome this issue of having to generate unique values at all times through custom code and to support the auto generation of a codes based on a given seed and format value, ‘AutoNumber’ data type was added.
Until now, the way to use new AutoNumber data type was to create a new field with the AutoNumber data type. This means, if you have been using a text field until now to store the auto-number generated through custom code and now want to switch to the in-built auto-number data type field, then you have to create a new one, you could not reuse the same field.
But now with the new maker experience at https://make.powerapps.com, it looks like we can change the data type of an existing Text field to AutoNumber.
Once you change the data type to AutoNumber, you have all the configuration properties available.
With the String prefixed number type, you could generate values as shown below:
And the Date prefixed number could be used for generating a sequential code for each date.
It does not support generating number by the month like 2020-06-1000, 2020-06-1001 and so on. To do this, change the AutoNumber type to custom. Since my previous selected format was date prefixed, it auto-fills the format based on that and then we can edit the format as per our need.
In case you want to generate codes similar to how Microsoft does for the OOB case entities, where along with a prefix and sequential number, it also adds a random string, you could do that by setting the format as follows:
Go ahead and switch to using AutoNumber data type without worrying about historic number sequence and continue using the same field as before.