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 / Power apps using colle...
Power Apps
Unanswered

Power apps using collections, forms and improving performance

(0) ShareShare
ReportReport
Posted on by 138

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.

Collect(MyGoalsCollection,Filter('Goal tracker',SPName.Email=User().Email))

 

For each form,

The button OnSelect is:

SubmitForm(AddGoalForm);Navigate(Home)

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:

  • it takes a while to display on the dashboard
  • If it doesn't display right away and the user refreshed the page they have to refresh multiple times.

 

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?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Jltitus ,

    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. 

     

  • Jltitus Profile Picture
    138 on at

    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.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Jltitus 

    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.

  • Jltitus Profile Picture
    138 on at

    No one user will exceed 2K.. so should I not use collection in that case?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Jltitus 

    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.  

  • TheRobRush Profile Picture
    11,128 Moderator on at

    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

  • Jltitus Profile Picture
    138 on at

    @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.

    Sort(Filter('Goal tracker',SPName.Email=User().Email),GoalName,Ascending)

     

  • Jltitus Profile Picture
    138 on at

    Figured it out 🙂

  • TheRobRush Profile Picture
    11,128 Moderator on at

    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

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard