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 / Generating Row Number ...
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.

Categories:
I have the same question (0)
  • EddieE Profile Picture
    4,641 Moderator on at

    @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?

  • Verified answer
    WarrenBelz Profile Picture
    154,966 Most Valuable Professional on at

    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

  • firda59 Profile Picture
    372 on at

    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. 

  • firda59 Profile Picture
    372 on at

    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

  • Verified answer
    WarrenBelz Profile Picture
    154,966 Most Valuable Professional on at

    @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

    @WarrenBelz 

     

    Still error, 

    firda59_0-1690335824482.png

     

  • WarrenBelz Profile Picture
    154,966 Most Valuable Professional on at

    Please see my amended post. You were too quick 

  • firda59 Profile Picture
    372 on at

    @WarrenBelz 

     

    Done, thankyouuu!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 516

#2
WarrenBelz Profile Picture

WarrenBelz 428 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 292

Last 30 days Overall leaderboard