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 / How to display the mos...
Power Apps
Unanswered

How to display the most recent rows in a SharePoint List in a Gallery

(0) ShareShare
ReportReport
Posted on by 753

I have an app with a Gallery and am using the following function to pull data from my SharePoint List into a Power Apps Gallery:

SortByColumns(Switch(varGalleryFilter,
1, Filter(VehicleRegistration, VehicleOnCampus="Yes" && Status="New"),
2, Filter(VehicleRegistration, VehicleOnCampus="Yes" && (Status="Rejected" Or Status="Completed")),
3, Filter(VehicleRegistration, VehicleOnCampus="Yes" && Status="New")
), "Created", SortOrder.Descending)

 

varGalleryFilter is set to 2 if the user clicks the "Archive" button. Currently, it only displays the first 500 rows in my SharePoint List. If I change the Data row limit to 2,000, I get all of my rows, but when I surpass 2,000 rows, I will run into the same problem. It was my understanding that using the "Descending sort order, I would get the most current rows, but it seems that I am getting the first 500. How can I get the most recent rows?

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Greg27,

     

    In this case you could Sort the datasource before Filtering. Currently you will sort the returned output of your Filter() function.

     

    Filter(
     Sort(
     VehicleRegistration,
     Created,
     SortOrder.Descending
     ),
     VehicleOnCampus = "Yes",
     (Status = "New" && (varGalleryFilter = 1 || varGalleryFilter = 3)) ||
     ((Status="Rejected" || Status="Completed") && varGalleryFilter = 2)
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • Greg27 Profile Picture
    753 on at

    @LaurensM 

    Thanks so much for your help. It worked perfectly!!

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard