Power Apps – Serial Reference Numbers
4 steps
Introduction:
This is the blueprint of a simple reference number system that adds up/increments. The format in this example will be REF0000 where “REF” is a fixed text and 0000 will be the serial identifier. We will use a collection for this example but you can apply it to your data source such as SharePoint or Dataverse.
Step 1:
Insert a button named Button1. Change the following properties:
Text property
"New Item"
OnSelect property
Collect(collRefNumbers,
{
RefNumber:"REF" & Text(Value(Mid(First(
Sort(collRefNumbers,RefNumber,SortOrder.Descending)
).RefNumber,4))+1,"0000")
})
Step 2:
Insert a button named Button2. Change the following properties:
Text property
"Clear"
OnSelect property
Clear(collRefNumbers)
Step 3:
Insert a Blank Vertical Gallery named Gallery1. Change the following properties:
Items property
collRefNumbers
Default property
Last(collRefNumbers)
TemplateSize property
47
Step 4:
Insert a label named Label1 inside Gallery1. Change the following properties:
Text property
ThisItem.RefNumber
Conclusion:
To test, hit Play and click the New Item button. You will see that the reference numbers add up. Hit the Clear button to reset the reference number.
Did this article help? Let us know how we can improve. Send us a message by clicking the “Contact Us” button below.
Article last updated on Apr 23, 2024
Need expert guidance on Power Apps?