cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pwrappr01
Helper V
Helper V

How do I filter a SharePoint Lookup list based on text entered in a search box?

I have two SharePoint lists. List A has a series of names. List B shows who is assigned one of those names. When users are adding entries to List B, I need my PowerApp to let users search for a word such as "Microsoft" and have it then filter the drop-down lookup choices from List A so that only entries that contain "Microsoft" are available for selection.

 

I am very new to PowerApps and would appreciate any help y'all can provide.

9 REPLIES 9
RandyHayes
Super User III
Super User III

@pwrappr01 

You mention a DropDown...if so, have you considered using a ComboBox?  The ComboBox provides this functionality.

 

If you add a ComboBox and

1) set the Items to ListA.  Then set the Primary Text and the Search Field to the column in ListA that has the names you want to search.

2) Set the isSearchable property (or Allow Search) to true

 

You will now have a dropdown that users can type a name such a "Microsoft" and it will narrow the list down as they type.

 

I hope this is clear and helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes ,

 

That is very helpful. Is there any way to change the behavior of the search? I noticed it seems to default to a "Starts With".

@pwrappr01 

Hmmm, I've never noticed that...it searches full text from all I've ever done.

Here in this screenshot, I am (with all the same parameters I mentioned to you), searching for "th" in a list.  My list items are full text searched, not StartsWith.

pwrappr01.png

 

I've never tested this next statement to confirm, but it is possible that the functionality of that combobox may differ on different players and/or browsers.  In this case I am in the designer and using Edge.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes,

 

Strange. That is certainly not what I am seeing with the search. I have the SharePoint list added in Teams and am seeing the same result there when I perform a search as when I perform a search in Chrome, Edge, and Firefox.

 

Oddly enough, the search is not even retrieving known results. For example, I search "Exchange", and I get no results even though there are at least 2 of which I know in the list.

@pwrappr01 

Are you actually seeing "Exchange" in the list...without typing anything into the search?  I would check that first.

Make sure you have the Primary Text and the Search Field properties set correctly on your ComboBox.  This is very important.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes,

 

I do indeed. I can scroll and see multiple entries containing "Exchange" in the list. 

 

Regarding the Primary Text and Search Field settings, Value is the only option for both drop-downs.

@pwrappr01 

That is a bit bizarre that you see them in the list but when you type they disappear as options.

 

The reason you only see value is because you are most likely doing something like Distinct in your Items property for the ComboBox.

That shouldn't make any difference, but, just to test, try setting it to your datasource instead and then set the fields (display and search) to be the column you want and see if the behaviour is any different.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@RandyHayes ,

 

I thought so too. As far as what is currently in the Items field, it is another Choices('Name Tracker'.'Entry Name') formula. When I try to set it to the base data source ('Name Tracker'), I end up not even being able to set the search field to the 'Entry Namecolumn as it disappears from the list.

 

I also get a warning triangle that says "Search may not work well on large datasets". The source list only has under 600 entries.

@pwrappr01 

Ah...first, the size of the data.  You mention 600 items...is it under 500?  The default limit is 500.  If you need to bump that up to test anything, change it in your app settings.  But, this should not be an impact on the behaviour that you are seeing.

 

What kind of column is Entry Name?  

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (12,239)