web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : XcBxwl/EOTP3qeu05+Fpt5
Power Apps - Building Power Apps
Unanswered

Speed up performance of app with A LOT of galleries (and pdf)

Like (0) ShareShare
ReportReport
Posted on 25 Jan 2024 19:04:34 by 71

Hello!

I have a very unique use case of an app I'm building, and part of it requires galleries, a LOT of them. There are 40 galleries total, all of them in are within containers inside of another container that holds them all. Not sure if that's relevant at all, but the structure is:

 

  • Container0
    • Container1
      • Header label
      • Section label
      • Table gallery
      • Form gallery
    • Container2
      • Header label
      • Section label
      • Table gallery
      • Form gallery

 

And this repeats for 20 containers total, so that's 40 galleries total

 

I have the PDF function then pointing to Container0 to capture that big container filled with all the other 20 containers,

but the problem is this is VERY slow. It takes up to 2 minutes sometimes for the pdf to generate everything, and even without the PDF function, that screen is just very laggy when editing and to a lesser extent when running. It's crashed my chrome browser a few times with a "not enough memory" error even.

 

The data that is filling the galleries are all coming from collections that are loaded prior, so I thought that would make it quicker instead of reaching out to each SharePoint list directly. 

 

Does anyone have any ideas as to how to make this any faster/more efficient? 

 

Thank you!

I have the same question (0)
  • BCLS776 Profile Picture
    8,990 Moderator on 01 Feb 2024 at 17:23:46
    Re: Speed up performance of app with A LOT of galleries (and pdf)

    The newer PDF() function is basic at this time and trying to force it to do complicated things might lead to the issues you're seeing. For these kinds of PDF outputs, I almost always use a flow to populate a Word doc template, HTML, or another connector (Encodian, Adobe) that handles the workload outside of the app.

     

    Hope that helps,

    Bryan

  • _ru Profile Picture
    71 on 01 Feb 2024 at 17:16:34
    Re: Speed up performance of app with A LOT of galleries (and pdf)

    @BCLS776 hey bryan. thanks so much for all the tips. most of which i did/were already done. unfortunately i think the problem is just the amount of controls. it's really pushing it to the limit. instead i'm going to see if i can just push the data i need into a flow to assemble an html file and then either convert to pdf and store it, or send the html data back into a html label in the app and then point the pdf function to that label to see if that will print. 

     

    either way, i think i was just stretching the app too thing so need to start back at square one with this feature. i appreciate all the help though!

  • BCLS776 Profile Picture
    8,990 Moderator on 25 Jan 2024 at 19:25:31
    Re: Speed up performance of app with A LOT of galleries (and pdf)

    It's difficult to give you exact recommendations without a deep dive into your app, but here are some pointers to try:

    1. Load only the columns your app needs from your datasources, so that the resulting collections have fewer columns
    2. Load only the rows your app needs. For example, if you only work with records created in the last 30 days, load only those
    3. Open a monitoring session on your app, and pay attention to which operations take the longest.
    4. Whenever possible, replace a ForAll() with something that operates more directly on a table
    5. Use the HTML text control to replace a nested gallery, if its main purpose is display only
    6. Remove unneeded controls
    7. Remove references to controls on screens other than the active one
    8. Use named formulas (a relatively new feature) when possible

    You mentioned "form gallery" in your post. Forms and galleries don't play well within one another. If that's what you are doing, try to avoid it.

     

    Hope that helps,

    Bryan

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 982 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 396 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 356

Last 30 days Overall leaderboard
Loading started
Loading complete