cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Optimize "Get items" performance

Hello everyone,

 

I'm experiencing performance issues with the "Get items" action to retrieve items from my SharePoint list. Currently, the execution of this action can take more than 30 seconds, which is too long for my use case.

 

Here's what I've already implemented to optimize performance:

  • Filtering: I filter only on indexed fields
  • Columns: I retrieve only the necessary columns (thanks to "Limit Columns by View")
  • Maximum number of elements: I have limited the number of elements retrieved to 500 (thanks to "Top count")
  • Pagination: I have activated pagination, also with a limit of 500 elements

 

Here are a few more details that might be useful:

  • SharePoint Online list: The list I'm working with is quite large (over 30,000 items)
  • Context: The "Get items" action is crucial to my workflow and needs to be as fast as possible, as it returns data to the user of a Power Apps application

 

I'm looking for additional tips or techniques to improve the performance of this action. Are there any settings or practices I may have missed? Specific configurations for large SharePoint lists?

 

Any help or suggestions would be greatly appreciated. Thank you in advance for your time and expertise.

 

Best regards,

Charles

1 ACCEPTED SOLUTION

Accepted Solutions

@CharlesPP 

I have done some work optimizing a flow using the SharePoint HTTP action to return items to a Power App and I have gotten it to return up to 20,000 items to the app in under 10 seconds. And it will work for any combination of filtering and/or searching the list.

https://powerusers.microsoft.com/t5/Community-App-Samples/No-Delegation-Limit-SharePoint-List-Power-...

 

Video explaining more of the flow: https://youtu.be/V1d3V_cWVaA?si=C1t1AsxkK5Aruqvd 

 

This method of only doing batches of up to 5000 at a time in a concurrent Apply to each should also get around issues you previously mentioned where you couldn't apply multiple filters at once. Because it does allow more filters to be applied when your initial piece of the query, like querying on the ID column, restricts the initial outputs to less than the 5000 list view threshold. 

 

_____________________________________________________________________________

Subscribe to my YouTube channel

View solution in original post

15 REPLIES 15

Are you able to filter the list directly with the power app?

 

Reza Dorrani - Power Apps Search and Filter Functions on Large SharePoint List

Thanks @wskinnermctc for the feedback. I had already seen this video and reviewed it to remind myself, but unfortunately it doesn't solve my problem, as almost all my filters are non-delegable (are multiple combo boxes) and non-mandatory (therefore don't bring back less than 2000 items). Currently, the filters entered are sent to my Flow Power Automate, which converts them into a filter query used in Get items.

royg
Impactful Individual
Impactful Individual

Haven't tested, but perhaps you can try using the Send HTTP action to get the filtered items and fields you need. Set the Auth header to 

Accept: application/json; odata=nometadata

 Hope this helps

Thanks for the suggestion!

I had tried this, but without adding the header.

I'm having trouble getting anything working with this technique, because when it does work, it goes very fast, but according to the filter query I get the error "BadGateway" I have no idea why, I haven't been able to identify where the error is coming from.
Here's an example of a query that gives "BadGateway":

_api/Web/Lists/GetByTitle('MyList')/Items?$select=ID,Origine,Historise,MyLookup/Title,[.....]$expand=MyLookup,[.....]$filter=(Origine eq 'Réglementaire') and Historise eq 0&$top=2000

But when I run the filter query with certain values other than "Réglementaire", it works... This is an example, but most filter queries don't work, even though they work with Get items. I tried using the uriComponent() formula on the filter query, but it didn't solve the problem.

Thank you very much for your help.

royg
Impactful Individual
Impactful Individual

Interesting, I added that value to a text field in a list and was able to filter by it. perhaps it's a combination of the expand. can you exclude it (you can add a different query for the lookup list and join the values by the id later)

This is really strange. I ran some tests simplifying the query and here's the result. "Origine" is a choice field with the values listed in the following tests :

 

Does not work :

_api/Web/Lists/GetByTitle('Echeances')/Items?$select=Origine,Historise&$filter=(Origine eq 'Réglementaire') and Historise eq 0&$top=2000
_api/Web/Lists/GetByTitle('Echeances')/Items?$select=Origine,Historise&$filter=(Origine eq 'Réexamen périodique') and Historise eq 0&$top=2000

 

Works :

_api/Web/Lists/GetByTitle('Echeances')/Items?$select=Origine,Historise&$filter=(Origine eq 'Conformité') and Historise eq 0&$top=2000
_api/Web/Lists/GetByTitle('Echeances')/Items?$select=Origine,Historise&$filter=(Origine eq 'Inter-Réexamen') and Historise eq 0&$top=2000
_api/Web/Lists/GetByTitle('Echeances')/Items?$select=Origine,Historise&$filter=(Origine eq 'Autres') and Historise eq 0&$top=2000
_api/Web/Lists/GetByTitle('Echeances')/Items?$select=Origine,Historise&$filter=(Origine eq 'Courrier') and Historise eq 0&$top=2000
_api/Web/Lists/GetByTitle('Echeances')/Items?$select=Origine,Historise&$filter=(Origine eq 'DAPE') and Historise eq 0&$top=2000

 

 Thanks in advance!

royg
Impactful Individual
Impactful Individual

Wow, if you query all items, no filtering, do you see Réglementaire or Réexamen périodique  in the returned data?

Yes, I find "Réglementaire" and "Réexamen périodique" in the "Origine" choice field when I don't set any filter.

CharlesPP_0-1706085392835.png

I've given the example of the "Origine" filter, but I've seen similar things in other fields.
For example : 

  • The filter on the "Reference" text field always works : _api/Web/Lists/GetByTitle('Echeances')/Items?$select=Reference,Historise&$filter=(Reference eq 'MyReference') and Historise eq 0
  • The filter on the "MainAffaireTome" lookup field never works (BadGateway) : _api/Web/Lists/GetByTitle('Echeances')/Items?$select=MainAffaireTome/Title,Historise&$expand=MainAffaireTome&$filter=(MainAffaireTome/Title eq 'Lookup value') and Historise eq 0
  • The filter on the "Date" date field never works (BadGateway) : _api/Web/Lists/GetByTitle('Echeances')/Items?$select=Date,Historise&$filter=Historise eq 0 and Date ge '2040-01-01'

 

If you have any ideas, I'd be glad to hear them. These filter queries all work with Get items.

After a few tests, I'm wondering if this isn't related (in part) to the volume of data returned, here are some other examples that make me think this:

Does not work:

_api/Web/Lists/GetByTitle('Echeances')/Items?$filter=(Origine eq 'Réglementaire') and (Date ge '2040-01-01')
_api/Web/Lists/GetByTitle('Echeances')/Items?$filter=(Date ge '2010-01-01')

 

Works:

 _api/Web/Lists/GetByTitle('Echeances')/Items?$filter=(Date ge '2040-01-01')


What's surprising is that filtering on the date after 2040 AND having a filter on the origin doesn't work, while filtering only on the date (2040) does.

Thanks a lot!

Hello, I would like to re-launch this topic. Do you have any ideas for improving the performance of "Get items" in my context, or for solving my bug when using "Send an HTTP request to SharePoint"? Many thanks in advance !

Can you try indexing the specified columns?

Thanks for your answer! I already filter only on indexed columns.

@CharlesPP 

I have done some work optimizing a flow using the SharePoint HTTP action to return items to a Power App and I have gotten it to return up to 20,000 items to the app in under 10 seconds. And it will work for any combination of filtering and/or searching the list.

https://powerusers.microsoft.com/t5/Community-App-Samples/No-Delegation-Limit-SharePoint-List-Power-...

 

Video explaining more of the flow: https://youtu.be/V1d3V_cWVaA?si=C1t1AsxkK5Aruqvd 

 

This method of only doing batches of up to 5000 at a time in a concurrent Apply to each should also get around issues you previously mentioned where you couldn't apply multiple filters at once. Because it does allow more filters to be applied when your initial piece of the query, like querying on the ID column, restricts the initial outputs to less than the 5000 list view threshold. 

 

_____________________________________________________________________________

Subscribe to my YouTube channel

Thanks for your reply! It works correctly and quickly (less than 5s), I've adapted your flow to my use case and simplified the process. However, it crashes when the filter query is too long, which doesn't happen with Get items. Do you have any idea how to fix this?

Also, would you have any idea why my previous attempts failed (see previous posts).
Thanks a lot!

 

@CharlesPP 

I’ve used 3-4 filters at once with this set-up, what is the error you are getting?

 

And what specific previous issues? If you mean applying multiple filters then it is because SP is limited to what filters it can use on different columns if it is trying to apply said filter to more than 5000 rows.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,287)