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

Top Solution Authors
Top Kudoed Authors
Users online (38,468)