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

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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard