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 / How to add dynamic row...
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:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,454 Most Valuable Professional on at
    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
  • AR-03090625-0 Profile Picture
    28 on at
    Hi WarrenBelz,
     
    Thank you very much! It perfectly work.

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 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard