cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dsgnmind
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
eka24
Super User III
Super User III

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
eka24
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.

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

eka24
Super User III
Super User III

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.

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

eka24
Super User III
Super User III

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

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

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)))

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?

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
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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

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

Top Solution Authors
Top Kudoed Authors
Users online (39,961)