cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Collection Build Time

Just curious if someone could possibly explain Collection processing time guidelines base on experience and/or documentation?  There may not be an exact answer, but I'm running into an issue that makes it very difficult for end users when searching because of the loading time, and I'm trying to find a happy medium to work with.

 

My current conditions are as follows

  • I have a gallery [SearchGallery_1] Item's property that's filtering from a SharePoint list based on the text entered into a text input box.  The gallery produces the results I need pretty quickly... usually around a second for every 50 records to completely load, so for example, it takes around 3 seconds if the search produces 150 records.
  • For  a host of reasons (mainly multiple level filtering), [SearchGallery_1] is not visible as I am using the results of this gallery to build a collection [_SearchGalleryResults].  However, for reference, here is a link to a thread I started specifically about why I was doing this that I got absolutely no bites on, but was able to work through it (https://powerusers.microsoft.com/t5/Building-Power-Apps/Filtering-within-Pop-Up-Guidance/m-p/857070).
  • My collection is initiated/built based on the Search Text Input box's OnChange property with the DelayOutput set to true.
  • I have a visible gallery [SearchGallery] (which the user can see results in) that has it's items property to display the results of the built [_SearchGalleryResults] collection.

Issue and reason for question about Collection build times

  • In my testing I will place the non-visible SearchGallery_1 in a visible status so I can compare the two galleries as I type search text into my text input box.  As always, the SearchGallery_1 pretty much instantaneously shows my results, but the visible SearchGallery takes roughly 5 seconds for every 10 records I have.  So, that 150 record result used as an example above can take 1 to 1 1/2 min's to show the results.  Note that before I changed the text input DelayLoad property to true, the process would take twice as long and even lock up the app (even in the app edit mode) and force me to close out if it was a larger pool of records.  
  • I fully understand the Collection must build from the SearchGallery_1 results before my visible SearchGallery gallery can display the results, but this process seems to take a much longer time than it should.  This is strictly my opinion based on the fact that I'm doing something very similar with another screen's OnVisible property and the gallery results are produced fairly quickly.  The only difference being that the results of this gallery are static and not dependent on changing search text.
  • I personally think the delay is tied to what I am using to initiate/build my collection (OnChange property of the text input), but to my knowledge, I don't think I can build a collection once a gallery fully loads. Seeing that my collection depended SearchGallery_1 is pretty much instant, this would be a better option over what I'm currently doing.    

With all that being said, I'm hoping I can get some experts opinions on what I'm experiencing here and see if there's something I could do a little different to help minimize the load time?  It's almost unbearable, but, I absolutely need to maintain my multi-level filtering functionality.  

3 REPLIES 3

@forbudt4u 

So, I looked at your referenced post as well.  I think you got no hits on it because you hit on it yourself.  A lot of us that answer posts in here will scroll through the lists looking for posts with 0 responses.  If a post has a response or more, then we move on to the next.  There are just too many posts to read all.  So, in the future, you might just Edit your original post and add new information as needed.  Otherwise it looks like someone is responding.

 

Now....that said.

Collections are overhead for your app.  Consider that (especially looking at the other post) you are duplicating data over and over and over again.
You first have the main collection - your datasource.  Many don't realize, but this is already a "collection"/table.  It has some very special "powers" to it to be able to get data as needed and to sync with the main session table (the one that gets created in the cloud when you start your app).

So...if you then duplicate all of this into a collection, then you end up forcing the data on demand feature of the datasource which causes it to then get all the data and send it to your app collection (the datasource, not your other collection).  So, now that this datasource has the table, your ClearCollect is clearing an in memory table and then duplicating all the data in the datasource table into the collection table.  

THEN you are using that collection as the basis for the Gallery search results and THEN you are creating a collection on the Gallery results to use on another Gallery.  PLUS, each time the screen is made visible, you are clearing all the collections and doing it all over again!

Can you sense anything that might slow your app down yet??

 

PowerApps is a no-code solution platform.  It is build with the same concept as Excel with referential formulas and calculations.  It builds on that power tremendously with other functions, but that first point should never be lost.

Think about Excel...if you build a formula in a cell to do some calculation on, let's say, some costs and quantities, if you then need to calculate tax percentages or other additional calculations, you build on that cell by putting a formula in another cell to reference the result of the first.  And...you repeat this process building on results to get you what you want in all places.  You DON'T create a variable for each cell and then set other cells to build on the variable...that doesn't makes sense.  Yet, there are places for that in Excel.

Why mention this?  Because Collections are variables.  They are snapshots of tables at a given point of time.  They do NOT update unless you update them.  And...the answer usually is - ClearCollect.  Which means they are flushed and refilled - a time consuming process.

 

My suggestion and advice is this.  There are only a handful of places where a collection is REALLY needed.  Try to avoid using them unless you have those scenarios (offline ability, the inability to delegate, an in memory database).

Use the datasource directly.  Cut out the redundant Galleries.  Place well structured formulas in your Items properties.  Utilize dynamic data when possible. Don't try to "engineer" a solution to a performance problem that you created based on a problem you didn't have.  If your app is done and you experience performance issues, THEN resolve the issue.  Keep it Super Simple!! 

 

From the experience side of things, we design a lot of apps.  From fairly simple to very complex (speaking in terms of business logic).  Rarely do we use a collection.  Never do we use invisible Galleries to provide data for another.  Rarely do we use invisible controls for data for others.  Often do we use dynamic variables (I wish I could get my video done on this process...it is extremely valuable).  Always do we keep it simple.

 

So, that is my $0.02 on the subject.  Too often do people think the answer to performance is a collection.  More often do people find that once they have them in place, performance gets worse.  Now, my statements are "in general" for everything here.  There is a time and place for all the pieces available in the PowerApps suite.  But, you don't always need a heavy tractor trailer truck if all you need to haul is a table lamp...and you just might find that the tractor trailer creates some expenses and problems you would never have had before.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

 

Thank you for your honesty.  I definitely see where me replying to my post could have caused confusion and that's why I didn't get any replies. 

 

From a logic standpoint, everything else you touched on ALL makes sense and I can follow it.  In my linked original post (and in this one), I tried to relay that I didn't think using a collection was the best route to take.  I also didn't understand why the original developer used that method for our main screen OnVisible property to formulate the original pop-up filter or why they used a pop-up for our admin portal over a separate screen.  However, that's what they did and that's where I'm at.  Unfortunately, the developer in question suffered the fate a lot of companies have due to Covid, so we're stuck trying to resolve a lot of issues not having anyone to ask questions to or development docs to rely on.

 

Your advice has pretty much convinced me that I need to totally go back to the drawing board on our main Asset Management Screen, Admin Portal, Galleries, and filters as a whole.  The sad part is that it's doing what I need it to do, it's just taking too long with one important aspect.  

 

Thanks again, Randy!

@forbudt4u 

The unfortunate part is that a lot of designers reuse the "examples" found in the docs.  These weigh heavily on collections for "quick examples".   How many times have you sat through a presentation about development where the presenter said - "now, you wouldn't do it this way in your development, I'm just doing this to demonstrate the core topic."?  Unfortunately the docs don't say that.  Then compound that with people who start doing that method and then do blogs and videos with it...pretty soon everyone thinks that's just how you do it.  It's not!!  My guess, in looking at that formula in the other post, your designer got a lot of his info from those sources without really grasping the concepts.

Now, my best suggestion would be to re-do it and get rid of it and design it 1000% better.  But, it sounds like you are constrained from that.  So, perhaps some simple changes like, in the OnVisible, checking to see if you have ALREADY collected the data.  If not, then do it.  If so, then don't.  Also looking at the Gallery formulas and combining them in a way to reduce the redundant gallery.

Little things like that can help a lot. 

Also, make use of the monitoring tool to really focus on what IS and what IS NOT a performance issue.  If you want the most for any changes you make, use that tool to make sure you are really changing something that is causing a problem.  Nothing worse then putting an hour into redesigning something to solve a problem, only to find that the problem still exists.

 

And, as always...post on the forum if you get stuck or have questions...just be careful - you'll get a lot of "you need a collection for this" responses sometimes - because there is a "conditioning" that that's the way you do it.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages