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

Multiple filters for gallery items (including search and sort)

I am fairly new to powerapps and am trying to figure out how to filter gallery items based on a value while leaving the search feature intact.

 

Here is my initial gallery.items syntax: SortByColumns(Filter('Shakopee Hot Board', StartsWith(Supplier, TextSearchBox1.Text)), "Supplier", If(SortDescending1, Descending, Ascending))

 

I would like to leave that as is, but want to add a filter to show items when a particular yes/no column in equal to no. Any ideas on how to do this would be great.

1 ACCEPTED SOLUTION

Accepted Solutions
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Multiple filters for gallery items (including search and sort)

The Filter function can take multiple conditions, so for that case you can add another condition in the filter:

SortByColumns(
    Filter(
        'Shakopee Hot Board',
        StartsWith(Supplier, TextSearchBox1.Text),
        YesNoColumnName = false),
    "Supplier",
    If(SortDescending1, Descending, Ascending))

You can also compose the filter function with other functions that operate on tables, such as Search. You can use the result of a filter as the input of a search, and vice-versa. For example, if you wanted to add a search in this operation, you could use something along the lines of

SortByColumns(
    Filter(
        Search(
            'Shakopee Hot Board',
            TextSearchBox2.Text,
            "Name", "Description"),
        StartsWith(Supplier, TextSearchBox1.Text),
        YesNoColumnName = false),
    "Supplier",
    If(SortDescending1, Descending, Ascending))

View solution in original post

2 REPLIES 2
Power Apps Staff CarlosFigueira
Power Apps Staff

Re: Multiple filters for gallery items (including search and sort)

The Filter function can take multiple conditions, so for that case you can add another condition in the filter:

SortByColumns(
    Filter(
        'Shakopee Hot Board',
        StartsWith(Supplier, TextSearchBox1.Text),
        YesNoColumnName = false),
    "Supplier",
    If(SortDescending1, Descending, Ascending))

You can also compose the filter function with other functions that operate on tables, such as Search. You can use the result of a filter as the input of a search, and vice-versa. For example, if you wanted to add a search in this operation, you could use something along the lines of

SortByColumns(
    Filter(
        Search(
            'Shakopee Hot Board',
            TextSearchBox2.Text,
            "Name", "Description"),
        StartsWith(Supplier, TextSearchBox1.Text),
        YesNoColumnName = false),
    "Supplier",
    If(SortDescending1, Descending, Ascending))

View solution in original post

kbwissi
Level: Powered On

Re: Multiple filters for gallery items (including search and sort)

This worked great, thank you! In one screen of my form, I need to actually filter by two yes/no columns. When I try to add this, no items are being returned.

 

SortByColumns(Filter('Shakopee Hot Board', StartsWith(Supplier, TextSearchBox1_2.Text), Universal_x0020_Completed = false, Universal_x0020_Acknowledged = true), "Supplier", If(SortDescending1, Descending, Ascending))

 

Universal_x0020_Completed and Universal_x0020_Acknowledged are my yes/no columns. If I have just one of them in the filter, it works fine.

 

Thanks!

 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,471)