cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Continued Contributor
Continued Contributor

Query a SP list with greater than 33k items

Greetings,

 

I am seeking the option to pull data into an app based on one or multiple search criteria.  The SP list, where the data is housed, has 33k + items.  My goal is to provide the user a Search screen and not pull any data into the app until they query it.  If a user selects multiple criteria, i.e. State, Project Year, and Project Category, I would like to display the data in a gallery.  If a user selects a unique item, based on project number, then I would like to display the details for that project in a DisplayForm or Labels.  

 

The question is - how can i query the data in SP.  I understand delegation and was trying to test by displaying a project utilizing the Lookup function.  However, that does not work. 

 

Tagging all who I follow or have been most responsive.  Thank you!

 

@v-monli-msft

@Shanescows

@Meneghino

@audrieg

@CarlosFigueira

@mr-dang

10 REPLIES 10
Highlighted
Community Support
Community Support

Re: Query a SP list with greater than 33k items

Hi @tianaranjo,

 

You could use a formula below to search for multiple columns:

 

Search( List, SearchBox1.Text, Column1 , Column2, ...  )

On the Visible property of the Gallery, set to:

If(IsBlank(SearchBox1.Text),false, true)

 

But notice that search function would become non delegable when using a lookup field. This is known limitation.

About the display form when picking an project number, you could insert a dropdown control, set the Items property to the project numbers like:

["1","2","3",....]

For the display form, set the data source to the list, and the Items property to:

ProjectNumber=Dropdown1.Selected.Value

Yet I just tested, this seems also non-delegatable.

捕获.JPG

 

When I test this, I used the ID column, and it seems that there might be something wrong with SharePoint and powerapps, I cannot get other columns like number column type. So I'm not sure if the non-delegation is related to the ID column. Please try with number field when able to see if this works.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Continued Contributor
Continued Contributor

Re: Query a SP list with greater than 33k items

@v-monli-msft- Thank you for you detailed reply.  

 

So, in essence, there is no way to work with a list this large and delegate the search to the SP source to only pull in the records a user filters on rather than trying to pull in all 33k items?  

 

Given that this is a known issue, is there a plan to change this in the near future?

Highlighted
Super User
Super User

Re: Query a SP list with greater than 33k items

If the columns you plan on using as filters are text fields and not a complex field type (e.g. Choice, Lookup, Date and etc) then you could write a filter formula that is delegable. Since your list is over 5k you will also want to make sure the fields you want to filter on are indexed in the SP list.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Continued Contributor
Continued Contributor

Re: Query a SP list with greater than 33k items

@Jeff_Thorpe

Jeff - thank you for your reply.  I'm a bit confused on thi because one response, from a MS Staff member says it is not possible to delegateand bring back the data given the number of items in the list. You are stating it is possible.  

 

Yet, I have read all your posts related to this on other inquiries and applied as you have instructed others with no luck.  The column I am trying to filter is a single line of text column.  The data within the column is a unique project number (as text).  This large 'Master Project' list has indices established.  Is there something in the formula that must point to the indexed column?  if so, can you please post an example?

 

Thank you.

Highlighted
Super User
Super User

Re: Query a SP list with greater than 33k items

Certain query functions and field types are delegable and others are not. If you are using a non-delegable function or field type then list size and the non-delegable query size limit comes into play. If you are using field types and functions that are delegable for your data source then you have some options. For example I have a sample list that contains most of the US Zip Codes. That list has almost 41k items. I have built a gallery that will filter that list on "New York" and with a lot of scrolling the gallery is showing 2,153 zip codes which above the non-delegable query size limit. I am able to do this because I am using delegable functions, operators and field types support by the data source. In my case I am using SharePoint, Filter(), "=" operator, text field in SP and my state column in the SP list is indexed.

 

FYI: It isn't a great experience scrolling through 2k+ records in a gallery.

 

NewYorkExample.png



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Super User
Super User

Re: Query a SP list with greater than 33k items

Hi @Jeff_Thorpe. What were the load times of that gallery after "New York" was selected?

Highlighted
Continued Contributor
Continued Contributor

Re: Query a SP list with greater than 33k items

@Jeff_Thorpe  

 

Jeff - will you please show how you reference the indexed column in your fx to the SP list.  Is it similiar to SQL where the datasoure is appended with the indexed column name, for example: 'Datasource'.ProjectSeqNo?

 

I would greatly appreciate it if you would share the formulas for the below example you provided.

 

Thank you!

Highlighted
Super User
Super User

Re: Query a SP list with greater than 33k items

@tianaranjo, I reference the SP column name like you would any other SP text field in PowerApps. In SP I went to the list settings page and clicked on "Index columns" in the column section.  Then clicked on "create a new index" and selected the State column.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Highlighted
Super User
Super User

Re: Query a SP list with greater than 33k items

@seadude,

 

The gallery only loads the first 100 then when you scroll to the bottom it loads another 100. In order to get them all to show in the gallery I have to scroll to the bottom to get another hundred to load then scroll up a little and back down to the bottom to get the next 100 to load. You just keep doing this process and all the items will show in the gallery. Each batch of 100 items only took a few seconds to load but the process of scrolling up and down was not user friendly.



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,920)