web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Genarate row numbers i...
Power Apps
Answered

Genarate row numbers in collection

(0) ShareShare
ReportReport
Posted on by 122

I want Genarate Row Number in the Collection. I have a collection like this:

Edward00_0-1689482237729.png

And I want column No. in the gallery numbered:

Edward00_1-1689482307065.png

Gallery formula:

Edward00_2-1689482412171.png

 

Hope you can help me solve this problem. Thank you everyone.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,384 Most Valuable Professional on at

    Hi @Edward00 ,

    You can use the first part of the process in this blog of mine.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • Edward00 Profile Picture
    122 on at

    I want Genarate Row Number in the Collection. I have a collection like this:

    Edward00_0-1689482237729.png

    And I want column No. in the gallery numbered:

    Edward00_1-1689482307065.png

    Gallery formula:

    Edward00_2-1689482412171.png

     

    Hope you can help me solve this problem. Thank you everyone.

  • Verified answer
    narayan225 Profile Picture
    2,547 Moderator on at

    @Edward00 

    The following code should allow you to add row numbers into your collection.

     

    ClearCollect(colSolution, ForAll(Sequence(CountRows(colMyCollection)), Patch(Last(FirstN(colMyCollection, Value)), {RowNumber: Value})))

     

    You will need to create a new collection with the row numbers in.

     

    Cheers!

     

  • Edward00 Profile Picture
    122 on at

    After using the formula, my gallery has an error plus minus quantity button.

    Edward00_0-1689503168385.pngEdward00_1-1689503187447.png

    Is there a way to fix it? Thank you very much

  • narayan225 Profile Picture
    2,547 Moderator on at

    @Edward00 

     

    Because now you are using a new collection, you will need to reference that for those functions.

     

    I would suggest you to check the error message that comes up with those formula to know whats happening now.

     

    Cheers!

  • timl Profile Picture
    37,283 Super User 2026 Season 2 on at

    @Edward00 

    If you've changed the Items property of your gallery to colSolution as @narayan225 suggested, the most likely cause of this error is that you would need to Patch colSolution rather than colAddCart.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard