cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Text Search plus Combo Box Filtering?

I have a SP List of books called 'References', and use a multi-select choice column 'Reference_Location' with the choices: Classroom, Library, Online. Some book are in multiple locations. In my app, I have a collection made LocationCollection, a TextSearchBox, and ComboBox. I can get the gallery to filter according to the combobox selection, but only when a selection is the ComboBox is made, using this formula:

 

Filter(
References,
(ComboBox1.Selected.Value in Reference_Location.Value) && (TextSearchBox1.Text in Reference_Title & Reference_Author & Reference_Publisher & Reference_Keywords)
)

 

I've changed the ComboBox InputTextPlaceholder and NoSelectionText both to show 'all locations'

I've gone through the forums three times, and additional video, have tried many variations of IF, IsBlank, !IsBlank and || expressions, but haven't yet succeeded in getting all the records to show up when there is no selection made in the Combobox. I'm not worried about delegation, because there will be no more than 250 records ever in the SP list.

 

How can I get the gallery to show all records when there is no selection in the ComboBox?

Much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

SortByColumns(

If(
IsBlank(ComboBox1.Selected),
Filter(
References,
(TextSearchBox1.Text in Reference_Title & Reference_Author & Reference_Publisher & Reference_Keywords)
),
Filter(
References,
(ComboBox1.Selected.Value in Reference_Location.Value) && (TextSearchBox1.Text in Reference_Title & Reference_Author & Reference_Publisher & Reference_Keywords)
)
),"Reference_Author")

 

 

View solution in original post

11 REPLIES 11
Highlighted
Super User III
Super User III

Try

Filter(Search(
References, (TextSearchBox1.Text in "Reference_Title"),ComboBox1.Selected.Value in Reference_Location.Value))

Or

Filter(Search(
References, (TextSearchBox1.Text,"Reference_Title"),ComboBox1.Selected.Value in Reference_Location.Value))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

@eka24 Unfortunately, I'm getting multiple errors with both suggestions.

Highlighted

If you get error in this one, given a screenshot or the error:

Filter(Search(
References(TextSearchBox1.Text,"Reference_Title"),Reference_Location.Value in ComboBox1.Selected.Value))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Highlighted

Attached is an image. I haven't had much luck with the search function. 

Highlighted

What type is Reference_Location, is it a choice collumn in your table. If not remove the value at the end of "Reference_Location.Value"

Also on the combobox, Combobox1.Selected

Highlighted

@eka24 removing .Value did not alleviate anything.

As the original post states, Reference_Location is a multi-choice column, with three choices: Classroom, Library, Online. They are collected at app / onstart into the collection called LocationCollection, which the ComboBox1 Items point to.  Most other posts suggest using IF and IsBlank arguments, but no combination I could come up with populated.

 

I get the desired result, but only when the combobox has a selection using this formula:

 

Filter(
References,
(ComboBox1.Selected.Value in Reference_Location.Value) && (TextSearchBox1.Text in Reference_Title & Reference_Author & Reference_Publisher & Reference_Keywords)
)

 

Separately, I get the desired result, but only when the combobox has no selection, using this formula: 

 

If(
IsBlank(ComboBox1.Selected.Value),
Filter(
References,
(TextSearchBox1.Text in Reference_Title & Reference_Author & Reference_Publisher & Reference_Keywords)
)
)

 

But, I have not been able to combine both of these to work at the same time. 

Highlighted

If(IsBlank(ComboBox1),
Filter(
References,
(TextSearchBox1.Text in Reference_Title & Reference_Author & Reference_Publisher & Reference_Keywords)
),Filter(

References,
(ComboBox1.Selected.Value in Reference_Location.Value) && (TextSearchBox1.Text in Reference_Title & Reference_Author & Reference_Publisher & Reference_Keywords)))

Highlighted

Yes, this seems to do it, but adding 'Selected' at IsBlank

 

If(
IsBlank(ComboBox1.Selected),
Filter(
References,
(TextSearchBox1.Text in Reference_Title & Reference_Author & Reference_Publisher & Reference_Keywords)
),
Filter(
References,
(ComboBox1.Selected.Value in Reference_Location.Value) && (TextSearchBox1.Text in Reference_Title & Reference_Author & Reference_Publisher & Reference_Keywords)
)
)

 

Now that I got this working, I need to get it back to sort correctly. I tried wrapping it the Sort expression, but I probably don't have the right concept in my head. Sort( then IF? or does Sort go after this?

Highlighted

What colum do you want to sort.

Documentation;

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-sort

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,986)