cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

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:

 

Tommy

Lily

Tommy

Jack

Tom

Tommy

Jack

Beyonce

 

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.

 

Cheers.

 

 

5 REPLIES 5
Highlighted
Community Support
Community Support

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.

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

 

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.
Highlighted
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?

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Highlighted
Resolver I
Resolver I

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.

 

Thanks

Highlighted
Microsoft
Microsoft

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.

Highlighted
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.

 

Cheers,

ManCat


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,363)