I am working on an app for a program where users are presented with a Home screen/dashboard. From here they can add a goal(Add goal page w/ a form), or edit a goal (Edit goal page w/ a form).
To improve performance I have App OnStart that runs so that goals are filtered to just the user.
For each form,
The button OnSelect is:
The OnSuccess code is.
Notify("Changes successfully submitted. It will take a few moments for this item to display on your Home page dashboard.",Success); Collect(MyGoalsCollection,AddGoalForm.LastSubmit); ResetForm(AddGoalForm)
I also have a PowerAutomate that puts the current users SharePoint name in the SPName field.
The issue I'm running into is that when the user creates, or edits their goal:
ASK: Is there a way to improve this performance? Perhaps rather than running a PowerAutomate to capture the users SPName, is there an automatic way to capture that in the form so the user doesn't need to?
In your OnStart use Set(UserEmail,User().Email)) and use the global variable, UserEmail throughout your app if needed. I'm not sure that your collections are necessary. Why not just use the lists themselves. Your needing to refresh the collections will take time.
I'm using collections because the number of items could exceed the 2K of items in the SharePoint list that the app would have to filter. I understood that collections would support better user experience in that case.
Filter() is delegatable while Collect and ClearCollect still limit at 2k. If your are prefiltering your list to the user, will it actually exceed 2k items? Using the global variable will greatly improve performance at the start of the app.
It should not be necessary. Try it without them in your galleries and forms. I think you are likely making things more complicated than they need to be. Use delegatable functions and there shouldn't be a problem.
I am not sure how long it is taking for your gallery to refresh and show them what they have entered. In my experience it can take anywhere from 2 to 5 seconds for the calls to the datasource to start returning the fresh data. If that's the time frame you are experiencing I'd say its about right, and only way to improve it outside of upgrading your network would be to have your DISPLAY also based on the local collection you stored in the start of app, then when they add or edit save it in the local storage, and have a timer in the back that every x seconds checks to see if local storage matches splist data, and if not updates the splist and recollects it locally. This way it would display instantly since you would be making your edits locally and displaying that data for end user instead of waiting for it to call on the sharepoint list for visual changes. Same result just much faster for the user
@Drrickryp Thanks so much, I'm updating to not use collections to see how that plays out.
I'm thinking that rather than collecting and filtering by SPName(which I need to run Power Automate to get, I can delete SPName from my list and use the created by field but I'm having issues when filtering my gallery to only display those items where the created by is the current user, Do you have a recommendation? Below is the code using the SPName.
excellent, be sure to post here what helped you so if someone else has the issue and finds your post they will get an answer
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Join us on June 28 for our monthly User Group leader call!
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.