Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Generating Row Number in Gallery

(0) ShareShare
ReportReport
Posted on by 372

Hi,

 

I want to make a sequence number in my gallery, so people can see sequence of the machine based on list.

I tried this:

Clear(colNumberedMachine);
ForAll('Recap SOW',
Collect(colNumberedMachine,
Last(FirstN(AddColumns('Recap SOW',
"MachineNumber",
CountRows(colNumberedMachine)+1
),
CountRows(colNumberedMachine)+1
)
)
)
)

Source: Power Apps Guide - Formulas - Generating Row Numbers - Power Apps Guide - Blog

 

But, the label doesn't show the number. Can anyone help me?

 

Thank you.

  • firda59 Profile Picture
    372 on at
    Re: Generating Row Number in Gallery

    @WarrenBelz 

     

    Done, thankyouuu!

  • WarrenBelz Profile Picture
    148,060 Most Valuable Professional on at
    Re: Generating Row Number in Gallery

    Please see my amended post. You were too quick 

  • firda59 Profile Picture
    372 on at
    Re: Generating Row Number in Gallery

    @WarrenBelz 

     

    Still error, 

    firda59_0-1690335824482.png

     

  • Verified answer
    WarrenBelz Profile Picture
    148,060 Most Valuable Professional on at
    Re: Generating Row Number in Gallery

    @firda59 ,

    That is the Items of the Gallery, not the OnVisible code.

     

    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

  • firda59 Profile Picture
    372 on at
    Re: Generating Row Number in Gallery

    Hi @WarrenBelz 

     

    I put this code OnVisible function:

    With(
    {
    wList:
    Filter(
    'Recap SOW',
    StartsWith('# No. PO', cobacoba.Text))
    },
    ForAll(
    Sequence(CountRows(wList)),
    Patch(
    Index(
    wList,
    Value
    ),
    {RowNo: Value}
    )
    )
    )

    Then what should I do next? I input RowNo in my label text in Gallery, but error

  • firda59 Profile Picture
    372 on at
    Re: Generating Row Number in Gallery

    Hi @EddieE 

     

    I write the code in OnVisible, like this:

     

    firda59_0-1690334734471.png

     

    I want to show the number like 1, 2, 3, etc. 

  • Verified answer
    WarrenBelz Profile Picture
    148,060 Most Valuable Professional on at
    Re: Generating Row Number in Gallery

    Hi @firda59 ,

    If you use the first part of this blog of mine  you will have the column you need.

     

    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

  • EddieE Profile Picture
    4,641 Super User 2025 Season 1 on at
    Re: Generating Row Number in Gallery

    @firda59 

    I'm not sure how you are using this code by @timl , but it should be set up on a Button, Icon or any On... function eg OnVisible, App OnStart, etc

     

    You can use this code by @mdevaney directly on your gallery, if that is your design need?

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 770 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 494

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 399