cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mccoy
Frequent Visitor

Frustrated with performance when using SharePoint List and amount of data going across the network

I am finding several performance issues with PowerApps and after using the Monitor am discovering how inefficient it is.

 

For example, I have a function to count the number of rows in one list based on criteria.  In my case I have a list of projects and a list of issues.  The Project ID is one of the fields in the Issue list, so when I am showing a gallery of projects I want to show the Count of how many Issues each project has.  In PowerApps, I use a function like this:

CountRows(Filter(Issue, Project_ID=ThisItem.ID)))

 

In Monitor, when I look at the data being transferred for this one call, I see instead of a single value, such as 8, being returned that instead I get 8 rows of the entire Issue list being transferred across the network.

 

If instead I were writing this as a mobile app in Xamarin, I would have called a web service that returns the number 8 when I pass in a Project ID.  Or better yet, I would pass a set of project IDs and get back in a single call a set of issue counts.

 

Similarly, in SQL, I could write a query like this:

SELECT COUNT(ID) FROM Issue WHERE ProjectID = ?

 

And this would return for me a single number.

 

Why with PowerApps does it find the need to download all of the Issue records for the project in order to figure out how many of them there are?

 

Am I the only one out there who is frustrated by this?  Am I just doing something wrong?

 

Thanks for your answers in advance!

3 REPLIES 3
Super User
Super User

Re: Frustrated with performance when using SharePoint List and amount of data going across the network

Can you load all the Issues in a collection and then use the collection to count?

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com
mccoy
Frequent Visitor

Re: Frustrated with performance when using SharePoint List and amount of data going across the network

No I think that misses the point.  The only data I need to transfer across the network is the count of how many there are.  It seems horribly inefficient to transfer the entire list over and store as a local collection just to count them.

Super User
Super User

Re: Frustrated with performance when using SharePoint List and amount of data going across the network

@mccoy 
The COUNTROWS function cannot be delegated meaning SharePoint cannot perform the calculations on the server-side.  Only a few functions can do this.  See below.


List of functions that can be delegated in SharePoint:
https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/

 

My solution has been to store the count of issues in the SharePoint table for each project and increment/deincrement each time an issue is opened or closed.

 

Project IssuesCount
A 13
B 8
C 27

 

Then to display the IssuesCount inside of an app you could do a LOOKUP.

LookUp(your_projects_list, Project="A", IssuesCount)

 

What I like about my method is the IssuesCount is a stored value.  No calculations are being performed when the information is needed so speed to fetch the value is fast!

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (9,185)