Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

How to add dynamic row numbers to a gallery?

(1) ShareShare
ReportReport
Posted on by 28
Hello,
 
I have a gallery (Gallery4_1) filtered from another gallery  (BrowseGallery1_3) and I need to add row numbers to the last filtered gallery (Gallery4_1) which is dynamic depending on what the user select from the options given. Below is the code which I need to add extra code for a dynamic serial number (Label3_5).
 
First Gallery Name is BrowseGallery1_3
 
Last Gallery Name is Gallery4_1
Sort(Distinct(Filter(StaffMain, ActiveStat=false, Status2="Cadre",Section=Dropdown1_8.SelectedText.Value || Dropdown1_8.SelectedText.Value=Blank(), Nationality.Value=Dropdown1_12.SelectedText.Value || Dropdown1_12.SelectedText.Value=Blank()), Nationality.Value),ThisRecord.Value, SortOrder.Ascending)
 
Row Number needed for Label3_5
 
Can anyone help me?
 
Categories:
  • AR-03090625-0 Profile Picture
    28 on at
    How to add dynamic row numbers to a gallery?
    Hi WarrenBelz,
     
    Thank you very much! It perfectly work.
  • Verified answer
    WarrenBelz Profile Picture
    146,645 Most Valuable Professional on at
    How to add dynamic row numbers to a gallery?
    Try this - ThisItem.RowNo will be the Label Text
    With(
       {
          _Data:
          Sort(
             Distinct(
                Filter(
                   StaffMain, 
                   !ActiveStat, 
                   Status2 = "Cadre",
                   Section = Dropdown1_8.Selected.Value || 
                   Len(Dropdown1_8.Selected.Value) = 0, 
                   Nationality.Value = Dropdown1_12.Selected.Value || 
                   Len(Dropdown1_12.Selected.Value) = 0
                ), 
                Nationality.Value
             ),
             ThisRecord.Value, 
             SortOrder.Ascending
          )
       },
       ForAll(
          Sequence(CountRows(_Data)),
          Patch(
             Index(
                _Data,
                Value
             ),
             {RowNo: Value}
          )
       )
    ) 
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard