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 / Start RowNumber at 1 i...
Power Apps
Answered

Start RowNumber at 1 instead of 0

(0) ShareShare
ReportReport
Posted on by 104

All, 

 

 

I am creating a gallery with rows and it is starting at row 0. Is there another way for the rows to start at row 1. 

 

The gallery is connected to my collection and my code for the row label is 

 

aishak12_0-1641491677162.png

 

 

 

 

 

ThisItem.rowNumber

 

Categories:
I have the same question (0)
  • Jeff_Thorpe Profile Picture
    6,085 Super User 2024 Season 1 on at

    The gallery is just displaying the value of rowNumber for a record in your collection. I think you need to take a look at how that rowNumber value is being added to the collection. 

  • BrianS Profile Picture
    2,407 Super User 2024 Season 1 on at

    I'm not sure where the data is coming from for the rowNumber field. If you are trying to generate a row number in the collection this code will work:

    ForAll (CollectionName, 
     Collect(CollectionNumbered, 
     Last(FirstN(AddColumns(CollectionName, "RowNumber", CountRows(CollectionNumbered)+1),
     CountRows(CollectionNumbered)+1
     ) 
     )
     )
    )

    If all you need if for those numbers to start at 1 you could just set the property to

    ThisItem.rowNumber +1

    or if the data is text you could use

    Value(ThisItem.rowNumber) +1

    Obviously if you are using that to find a specific row you will need to subtract the 1 before the search

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @aishak12 :

    I'm not sure what's the meaning of  'start at row 1'.

    If you want to skip the first row (row 0) of the collection,you could set the gallery's items property to:

    Sort(Filter(YourCollection,rowNumber<>0),rowNumber)

    If you want the rowNumber in the collection to start at 1, then you can update your collection with this formula.

    UpdateIf(YourCollection,true,{rowNumber:rowNumber+1})

    Best Regards,

    Bof

     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard