cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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
Highlighted
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

Highlighted

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

Top Solution Authors
Top Kudoed Authors
Users online (8,292)