cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Filter gallery by text and combobox

I have a gallery I am attempting to search by text search box then an optional combobox. The gallery contains a list of devices and the searchbox can filter the list by the device's serial number or device type then the combobox can filter the devices based on their software.

 

I currently have the following as my code but nothing gets displayed in the gallery.

Filter(
    Filter(
        'Devices',
        StartsWith(
            'Number',
            TextSearchBox1.Text
        ) || StartsWith(
            'Type'.Value,
            TextSearchBox1.Text
        )
    ),
    'Software'.Value in ComboBox1.SelectedItems.Value
)

The data is stored in a sharepoint list. When I only use the text search box to filter the gallery it will work correctly but I cannot get it to work when I add in the combobox.

 

Any insight as to what I could be doing wrong and how to correct it is apprectiated. Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User II
Dual Super User II

Hi @gpedone 

 

2 filters are not required here

 

try

Filter(
'Devices',
(StartsWith(
'Number',
TextSearchBox1.Text
) || StartsWith(
'Type'.Value,
TextSearchBox1.Text
)) && 'Software'.Value in ComboBox1.SelectedItems.Value
)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

2 REPLIES 2
Dual Super User II
Dual Super User II

Hi @gpedone 

 

2 filters are not required here

 

try

Filter(
'Devices',
(StartsWith(
'Number',
TextSearchBox1.Text
) || StartsWith(
'Type'.Value,
TextSearchBox1.Text
)) && 'Software'.Value in ComboBox1.SelectedItems.Value
)

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

Thank you for the help, your suggestion helped. I needed to add that into a switch statement to cover the case where the combobox value was blank.

Helpful resources

Announcements
News & Announcements

Community Blog

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

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,310)