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 / same filter code in cl...
Power Apps
Suggested Answer

same filter code in clearcollect and items gallery property, huge time difference

(1) ShareShare
ReportReport
Posted on by 711
Hi,
 
I am trying to enhance the peformance of my app.
Loading data in a gallery takes a long time so I tested loading the data in a collection in stead of the gallery.
I use powerapps monitor and find that the code Filter(Mytable,Mycriteria) used in the items property of the gallery takes 43 seconds
However if I do ClearCollect(MyCollect,Filter(Mytable,Mycriteria)) it takes 2 seconds.
 
The difference would then be explained by code for the gallery item controls I presume?
Since monitor does not specify on that level is ther someway to find out except for scrutinizing alle code for every control?
Or is many controls with lots of specific for codes/colors/fills etc based on available item properties enought to cause this kind of performance drop?
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,963 Moderator on at
    Hi
     
    There are numerous reasons why, as you learn the platform better they make sense.
     
    However, without seeing your Code, without seeing your App, when and where the Gallery loads versus your ClearCollect, its impossible to give you a 100% answer, just impossible.
     
    BTW is this Dataverse or Sql or SharePoint?
     
    Regardless of which one you do, you should be using Views, to limit the column counts.
     
    ClearCollect is an instant thing. Many controls have intentionally buffering etc and delayed loading on purpose because they are async, where as the ClearCollect is not (at least not relative to your next lines of code).
     
    Also, how many records show up in the Collection, versus how many get displayed?
     
    Get the total count of records in the Gallery AllItemsCount, versus the ClearCollect

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

#2
11manish Profile Picture

11manish 224

#3
Valantis Profile Picture

Valantis 181

Last 30 days Overall leaderboard