Skip to main content

Notifications

Power Apps - Building Power Apps
Suggested answer

Display records in gallery in the same order as in SP list

Like (1) ShareShare
ReportReport
Posted on 13 Jan 2025 12:29:41 by 156
Hello!
 
I have a SP list with records where I can move a record by dragging it down or up - change it's position in a list. All of orders have it's ID number and I noticed that when I view my list on the app, the gallery is displaying my SP list in order by ID number. How do I view this list in gallery in the same order as it is in SP list, please? 
 
 
Categories:
  • WarrenBelz Profile Picture
    WarrenBelz 144,858 on 15 Jan 2025 at 21:49:49
    Display records in gallery in the same order as in SP list
    Hi @MP-13011217-0​​​​​​​
    SharePoint "order" is by default sorted by the ID. I suspect your SharePoint view is sorted by another field and you need to sort in Power Apps by the same field/s
     
    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    LinkedIn    Buy me a coffee
  • Suggested answer
    Mitanshu Profile Picture
    Mitanshu 1,604 on 15 Jan 2025 at 17:01:31
    Display records in gallery in the same order as in SP list

    If your SharePoint list does not already have a field to track the custom order (since users can drag and drop), you should add a "Position" or "Order" column to your SharePoint list. This column can be a Number field where you manually or programmatically set the order for each record.

    If you allow users to drag and drop records, you’ll need to update the "Position" column to reflect the new order. 

    You need to modify the Items property of the gallery to order the records based on the "Position" column instead of the default ID.

    SortByColumns(YourSharePointListName, "Position", Ascending)
     

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

Kickstarter Events…

Register for Microsoft Kickstarter Events…

Tuesday Tip #12 Start your Super User…

Welcome to a brand new series, Tuesday Tips…

Tuesday Tip #13 Writing Effective Answers…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,858

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,505

Leaderboard
Loading started