cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Search and Filter a Sharepoint list

Hi all,

 

I have a Sharepoint List with a couple of Choice (dropdown) columns.

 

In the powerapp, I have the sharepoint list as a data connection with a gallery that should display all items. I have added a text input search bar which allows a user to search by Title. This works perfectly.

 

 

Search('SharepointListName', SearchBarName.Text, "Title")

 

 

I'd also like to add a filtering option for users via a dropdown that filters one, ideally two of the choices in the sharepoint list. So far, I've got a form that is successfully connected to the correct Sharepoint Choice. The problem I'm having is I can't get the get the Gallery to filter using the form dropdown and search using the text input.... actually, the new code is absolutely broken.

 

 

 

Sort('SharepointListName',(Search(, SearchBarName.Text, "Title") Filter(DataCardValue51, "SharepointChoiceName"))

 

Appologies for the coding nightmare above, as you might be able to tell, it's not one of my strengths. Can anyone help me to get this working please?

 

18 REPLIES 18
Highlighted
Super User
Super User

Re: Search and Filter a Sharepoint list

try something like this:

 

Search(Filter('SharepointListName', DropDownField.Selected.Value = SharePointChoiceField.Selected.Value), SearchBarName.Text, "Title")

You will need to change the data source and field names to what your app is using. The formula should filter the list to items that match the selected drop down value and then if there is text in the search box it will filter the list down further.



--------------------------------------------------------------------------------
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
Anonymous
Not applicable

Re: Search and Filter a Sharepoint list

Hi Jeff,

 

Here's what I'm using on the Items value for the Gallery:

 

 

Search(Filter('Fixed Assets Register', BrowseFilterForm.Selected.Value = Site_x0020_Location.Selected.Value), BrowseSearchBar.Text, "Title")

 

 

But I'm getting the blue exlamation mark with following message:

 

 

Suggestion: Part of this Search formula cannot be evaluated remotely due to service limitations. The local evaluation may produce suboptimal or partial results. If possible, please simplify the formula. For more information, please see the Search function documentation.

Any ideas?

 

Highlighted
Super User
Super User

Re: Search and Filter a Sharepoint list

Search() is not a delegateable function in Sharepoint lists.  Instead, use Filter('SharepointListName',StartsWith(SearchBarName.Text, "Title") .  This will enable you to search lists larger than 2000 items.

Highlighted
Continued Contributor
Continued Contributor

Re: Search and Filter a Sharepoint list

@Anonymous - were you able to get this to work?  I have tried same method on an Indexed SP list with greater than 33k items with no luck.  If it works for you -- what fx did you apply?

 

Thank you.

Highlighted
Super User
Super User

Re: Search and Filter a Sharepoint list

I had a customer with a similar issue. In the end, we had to find ways to get the data in smaller chunks and not use the Search function. Sorry, it is not delegatable so you can't use it with large lists.

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
Highlighted
Continued Contributor
Continued Contributor

Re: Search and Filter a Sharepoint list

@Shanescows  Thank you.  I have been scouring for solutions and was coming to the same conclusion.  When you say you brought the data in in small chunks, did you find that affected the performance when the PowerApps was opened?

Highlighted
Super User
Super User

Re: Search and Filter a Sharepoint list

No. What we did was had the screens like such:

 

Projects > Office Buildings > Floors in building > List of items to install on the floor

 

You could not search/filter or much of anything until you got to the floor.

Shane - Microsoft MVP, YouTube, and PowerApps Consulting for when you are in a bind to get this fixed quickly. And finally we now have PowerApps Training
Highlighted
Anonymous
Not applicable

Re: Search and Filter a Sharepoint list

To hell with it, I gave up in the end and took a complete different approach to the project without using powerapps. Nevermind.

Highlighted
New Member

Re: Search and Filter a Sharepoint list

I have a sharepoint list that I am trying to use the search function and its working but will only allow me to search for the title on the browse gallery page. I want the user to be able to search by using keywords from the info in the columns of the list. This works perfectly when I am using a excel table as the datasource but not with the sharepoint list.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (11,488)