I have been working on this app for around 2 months now and is going to the finishing stage. I notice the app is pretty slow when loading on start up and load data between screens (especially when I'm using screen dependencies. Ex: Gallery.Selected). Majority of the suggestions from app checker are to use variables or collections. I tried searching for a tutorial on how to do that but the post PowerApp Optimization Technique is with SQL while my app is using SharePoint List. Also, I saw some post suggested to use ClearCollect and Concurrent but I'm having trouble with the coding. Can you please give me some suggestions on which one will work better with my app?
ClearCollect simply combines the functions Clear() and Collect() together, to simplify coding when you want to clear the collection and then repopulate it. No performance gain here.
Concurrent will allow you to execute multiple requests/functions in parallel. Some source systems, like CDS or SharePoint, will work well in this scenario. So instead of collecting 5 lists in order, you can concurrently collect all 5 - and the function ends when the slowest branch is completed. NOTE: This may impact the order of operations, so plan accordingly.
Global variables are slower than local variables, but have the advantage of being accessible on all screens. Local variables will remain set for a given screen, but have to be set/updated on the screen itself.
Check out the Monitor functionality as well, when testing your app. It will identify any heavy calls you have, and allow you to potentially reduce the number of calls, or the size of the call itself.
Hi @GarethPrisk ,
I'm guessing you are suggesting to use either Concurrent or maybe a local variable. With concurrent, from what I learned is you need to use a collection which I tried to import my datasource into a collection but no luck --> Collect(Collection1,'IE Report'). My datasource is approx. 1000 rows so it exceed the 500 limit. Also, the Collect option only works with a button (under onselect formula)? It suggested to use filter to limit data collection but I'm having trouble coding that.
Hi @eka24 ,
Thanks for the suggestion. I watched both of these videos but it doesn't have any tips regarding the problem that I am having right now. My main issue with delay loading is due to screen dependency which both of them didn't mention that in their video.
A few things to note, regarding 'App Performance.'
Do you mean?
The reason I ask is that we will want to determine if we need to fix 'subjective' or 'objective' performance issues. In some instances, the app is going to be limited by the connectivity (i.e. on good WiFi, or bad cell service, etc.). In those cases, you can load the data into the app using Collections, and then app will run faster since the operations are against the local collection. If/when you need to refresh the data, or write changes back, the connectivity factor still comes back into play.
As far as the Collect function. This is a function and can be invoked any way that a function can be invoked - not just On Select (here is a list of most (if not all) of the common behavior triggers...the OnX's).
Concurrent will allow you to run multiple function branches at once. This is most advantageous when loading data into collections.
In regards to Collecting data. You are correct that they are limited to 500 records by default. You can change this number under advanced app settings, from 1-2000. NOTE: This may work for your example of ~1000 records, but is not necessarily a long-term fix. If your table exceeds 2000 records, then you will want to consider switching back to a direct connection, or filtering/paging the data to get it into the collection within the delegation limit.
Let me know about what 'app performance' means to you, and we can troubleshoot/tweak based on your needs.
So my app is running slowly in a browser and I am under the company's wifi so internet won't be an issue. I can see it is running slowly due to me using (Gallery.Selected) throughout the app and the buffering dots still showing even though all of my data loads. As a quick fix, I refreshed the app and it was able to fix the issue right there but isn't for long term use. I use (Gallery.Selected) across 1-2 screens for different edit forms so I just want to find a way to cut the data loading time down.
I tried to load my data into a collection but since it is ~1000 records, it suggested me to either using lookup or filter. Could you show me a sample code that I can try to test it out? For my app, I have the user search for a code in a gallery, which then the information for that code is populated into a form on the next screen; hence I used (Gallery.Selected)
For the Gallery.Selected stuff, you can pass that along as either a Context variable, or set a Global variable with the value (if passing the variable becomes too cumbersome).
Let's say you have Screen1, with Gallery1, and Screen2 with Gallery2.
The alternative would be to use a global variable.
Some other questions:
So the way that I set my app up is a little complicated since I used so many datasource (sharepoint list) for different forms.
I don't really pass the results from 1 gallery to another gallery but from gallery to a form.
So (screen 1) is home page and upon selection of a button ---> (screen 2) gallery to search for code ----> screen 3 (click to the corresponding department) ----> (screen 4) based on the selection, the needed info from that datasource is populated into the form (I'm guessing this is causing the delay of data load since it is not directly data transfer from screen 1 to 2 but from screen 1 to 3). All of these steps are linked to Datasource A which is ~1000 records. The results of this submitted form is going to a separate datasource (Datasource B), which builds up over time. My app is not technically updating any datasource but rather taking fields from one datasource and use that as an "ID" to save the submitted form in another datasource if that makes any sense. Datasource B would only be used if another department wants to check the results of that particular code.
>Can you please give me some suggestions on which one will work better with my app?
Please reference this: performance-tips
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Congratulations, the new Super User Season 2 for 2021 has started!
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.