Showing results for 
Search instead for 
Did you mean: 
Level 8

Auto-numbering based on name

Hi All,

I was wondering if it is possible to accomplish the following:


I would like to auto-number 'Like' items 1,2,3 etc.


By like I mean all the entries for the same name.


I have an app for issuing detentions to students. I would like to display in the gallery a number on each detention issued. The number would be unique based on the students name.


For example based on created date:











This would actually display as:

1         Tommy

1         Lily

2         Tommy

1         Jack

1         Tom

3         Tommy

1         Jack

1         Beyonce


The third for tommy would issue an afternoon via flow than the 1 or 2 etc.

The reason for this is that every third (3,6,9,12) etc I need to generate an email through flow to issue an afternoon or saturday detention rather than a week time lunch detention.


Any suggestions would be appreciated.





Community Support Team
Community Support Team

Re: Auto-numbering based on name

Hi @Newbie2019 ,

Do you want to generate auto-number based on type in PowerApps?

I'm afraid it's not supported to make it currently in PowerApps.

For now, we only have CountRows/CountIf function to count the row number meet the requirements. But automatic number

according to order is not supported.

I suggest you express your views about adding this function on PowerApps Ideas Forum. Your precious feedback will be very helpful for our work.



Best regards,



Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Auto-numbering based on name

Hi @Newbie2019 


If you create a number field in the datasource, and then have any new items in the form do something like:


CountRows(Filter(datasource, name=studentname)) +1



Then it should give you a '1' if there's no existing rows with that name, or a count of the rows+1 which should give you what you want - could you try incorporate that into your App and let me know how you progress?




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
Level 8

Re: Auto-numbering based on name

Hi @iAm_ManCat 


Thank you for your suggestion. I created a new 'number' column in my sharepoint list (MIMS) called Count.


Your formula would therefore be:


CountRows(Filter(MIMS, Count=Student)) + 1



Stupid question, do I place this within a data card in the edit screen or add it to my gallery as a simple label?


Confused about adding it to the app.


Any additonal steps would be appreciated.



Level: Powered On

Re: Auto-numbering based on name

Autonumber isn't the function you are looking for to do this. Autonumber creates sequential numbers for records as they are created. 

What it looks like you want to do is return a count for the number of records submitted against a student. You could use a CountRows function and use the student name from the name column to fine the number of applicable rows.

Super User
Super User

Re: Auto-numbering based on name

Hi @Newbie2019,


We are using CountRows to count the number of existing rows where Name (the column) contains "James Fern" for example, and then adding one to that, so you would set the value of the text input/label in the new columnsto the formula suggested.


Using count="Student Name" would not work, as that is looking for the name "Student Name" within the column Count, which there should be none as you have no data in that column yet.

What we want to do is get the number of existing rows where "Student Name" is within the column called Name.




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

Helpful resources


Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (5,597)