cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FryFubar
Level: Powered On

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
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.
FryFubar
Level: Powered On

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?

 

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.

tianaranjo
Level 8

Re: Search and Filter a Sharepoint list

@FryFubar - 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.

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
tianaranjo
Level 8

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?

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
FryFubar
Level: Powered On

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.

terrbo85
Level: Power Up

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 276 members 1,713 guests
Please welcome our newest community members: