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 / Collection with 50 las...
Power Apps
Unanswered

Collection with 50 last entries

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

i am looking for a way to speed up my mobile app. Therefore, i would like to use an OnStart property to only load the x amount of the last records from a SP list into a collection. My hope is that this way the app only needs a bit longer at the start, but then runs more fluently. I also do not need all the columns SP provides. Lets say i only need column A, column B, column C and all attachments.

The SP list contains on average 3-4 images as attachments per record and the SP list is ordered decending, saying the newest entry is at the top of the list. 

Currently, my issue is that i use the attachments in a gallery underneath a displayform for the clicked-on record and the pictures load forever.

Is this possible and if so, could someone point me into the right direction? I don't know exactly how to get the attachments into a collection so i could use them as well. 

 

 

 

Categories:
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    You could try this formula when the app is opened.

    ClearCollect(Test,0);ClearCollect(Test3,Filter(LastN(LIST78,50),'Has attachments'= true ).ID);ClearCollect(Test2,ForAll(Sequence(CountRows(Filter(LastN(LIST78,50),'Has attachments'= true ).ID)) As A,Collect(Test,Last(Test).Value+1);LookUp(LIST78,ID=Last(FirstN(Test3,Last(Test).Value)).ID).Attachments))

     

    Best Regards,

    Wearsky

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    The best way to get the last 50 records in a list is to use FirstN(Sort(splist, ID, descending),50). This method avoids delegation issues. Last() and Max() are not delegatable. First(Sort(... Will work with any number of records. 

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard