cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
gpedone
Level: Powered On

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

Re: Filter gallery by text and combobox

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

Re: Filter gallery by text and combobox

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

gpedone
Level: Powered On

Re: Filter gallery by text and combobox

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 69 members 3,541 guests
Please welcome our newest community members: