cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
efeewfew
Resolver I
Resolver I

App loading really slow (more than 2000 rows)

Hey there! 

I got a sharepoint list with over 2000 rows, so I am using the clearcollect trick to get access to all rows (about 6000)

But it is loading extremely slow (about 10 seconds). Is there any way I can make this code even faster?

Concurrent
(
    ClearCollect(col1; Filter('D-Nummers-OpleverApp'; UniekID >= 1 && UniekID <= 2000));
    ClearCollect(col2; Filter('D-Nummers-OpleverApp'; UniekID >= 2001 && UniekID <= 4000));
    ClearCollect(col3; Filter('D-Nummers-OpleverApp'; UniekID >= 4001 && UniekID <= 6000));
    ClearCollect(col4; Filter('D-Nummers-OpleverApp'; UniekID >= 6001 && UniekID <= 8000));
    ClearCollect(col5; Filter('D-Nummers-OpleverApp'; UniekID >= 8001 && UniekID <= 10000))
);;
ClearCollect(colCombined; col1; col2; col3; col4; col5);;

Concurrent(
    Set(gblUser;User().Email);;
    ClearCollect(ColAdminsOpleverapp;Admins.AdminsOpleverapp);
    Set(deelorderChosen;"0");
    Set(DateChosenYesNo; "")
);;

Concurrent(
Set(bedrijfNaam; LookUp(MontageBedrijven; gblUser = Email; MontageBedrijf));
Set(IsAdmin; !IsBlankOrError( LookUp(ColAdminsOpleverapp;AdminsOpleverapp = gblUser)))
)

 

Thanks in advance!

3 REPLIES 3
Nogueira1306
Super User
Super User

I don't think that it is a faster way to do that.

I think the 'problem' is that you have a lot of data and it will become slower, it is normal.

My only advice is for you to replace the "colCombined" and use directly your data source ('D-Nummers-OpLeverApp) and in your galleries filter it very well (you can do a sort of pagination).

 

https://www.c-sharpcorner.com/article/pagination-in-powerapps-gallery-control/

 

It is up to you

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,

Gonçalo Nogueira

Check my LinkedIn!

Buy me a coffee!

Check my User Group (pt-PT)!

Last Post on Community

My website!

Thank you for your reply @Nogueira1306 

But it is simply not possible to filter it back down so it gets below 2000 rows. This is a list of all of the projects, which are all needed to be loaded

WarrenBelz
Super User
Super User

HI @efeewfew ,

I am not sure whether this will be faster, but you can try it

Clear(colCombined);
With(
   {
      wSets: 
      With(
         {
            wLimits: 
            With(
               {
                  wLimit: 
                  Sort(
                     'D-Nummers-OpleverApp',
                     UniekID,
                     Descending
                  )
               },
               RoundDown(
                  First(wLimit).UniekID / 2000,
                  0
               ) + 1
            )
         },
         AddColumns(
            RenameColumns(
               Sequence(
                  wLimits,
                  0,
                  2000
               ),
               "Value",
               "LowID"
            ),
            "HighID",
            LowID + 2000
         )
      )
   },
   ForAll(
      wSets As MaxMin,
      Collect(
         colCombined,
         Filter(
            'D-Nummers-OpleverApp',
            UniekID > MaxMin.LowID && UniekID <= MaxMin.HighID
         )
      )
   )
)

My blog on the process is here.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (2,341)