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

Notifications

Announcements

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
    153,073 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
    153,073 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
    153,073 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard