web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Add search refiners
Power Apps
Answered

Add search refiners

(0) ShareShare
ReportReport
Posted on by 384

Hi all,

I'm looking for a way on how to implement multiple search refiners (checkboxes).

I was already successfull in implementing one, but I fail to implement the other (3).

This is what I currently have:

 

If(
 chb_filter_laptop.Value = false,
 If(
 IsEmpty(inp_search_bar),
 Filter(
 ITEquipment,
 !IsBlank(Title),
 Ascending
 ),
 Filter(
 ITEquipment,
 inp_search_bar.Text in Title
 )
 ),
 If(
 IsEmpty(inp_search_bar),
 Filter(
 ITEquipment,
 !IsBlank(Title) && Category = "Laptops & PCs",
 Ascending
 ),
 Filter(
 ITEquipment,
 inp_search_bar.Text in Title && Category = "Laptops & PCs"
 )
 )
)

 

I am sure that there is a much more elegant way on how to do this...

Maybe someone can give me some guidance on this?

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Frankie70 

    I am not clear on what Ascending is in your formula - is it meant as a Sorting reference or is this actually a yes/no column in your datasource?

     

    Excluding that, your formula should be:

    Filter(
     ITEquipment,
     (IsBlank(inp_search_bar.Text) || inp_search_bar.Text in Title) &&
     (!chb_filter_laptop.Value || chb_filter_laptop.Value && Category = "Laptops & PCs")
    )

     

    If you need to add more checkboxes, just follow the pattern above.

    Avoid using more than one Filter statement in your formulas as this will simplify your design and also will make maintaining and changing much easier.

     

    I hope this is helpful for you.

  • Frankie70 Profile Picture
    384 on at

    Hi @RandyHayes ,

    I thought Ascending would define the sorting order...

    I still do not understand where another checkbox i.e.

    Category = "Periphery"

    in the formula would go to.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Frankie70 

    If you want to sort, then you need to use a sort function.  You had nothing like that nor a column specified for sorting.

    But I am not understanding what you mean by checkbox in the Category = "Periphery" 

    What part of that is a checkbox?

  • Frankie70 Profile Picture
    384 on at

    Hi @RandyHayes ,

    I would like to build something like this

    Frankie70_0-1616842332108.png

    Here are 4 checkboxes that should work as filters. So, when a users checks Mobile Devices, only the devices of the category "Mobile Devices" will be shown in the gallery. The checkboxes can be combined aswell, so that it is possible to check "Mobile Devices" and "Periphery" for example.

  • Frankie70 Profile Picture
    384 on at

    Hi @RandyHayes 

    thank you very much! That works great!

    But how do I include the code for the other checkboxes (see screenshot in a later post)? I don not understand the syntax...:(

    For example this:

    (!chb_filter_mobile.Value || chb_filter_mobile.Value && Category = "Mobile Devices")

     

  • Frankie70 Profile Picture
    384 on at

    Hi @RandyHayes 

    could you please give me a hint how to include more checkboxes into the code? This would help me a lot!

  • Frankie70 Profile Picture
    384 on at

    Hello @RandyHayes

    I am really stuck here, I am not able to get the other 3 checkboxes to work in my fIlter.

    Probably because I do not understand the pattern of your code.

     

    Filter(
     ITEquipment,
     (IsBlank(inp_search_bar.Text) || inp_search_bar.Text in Title) &&
     (!chb_filter_laptop.Value || chb_filter_laptop.Value && Category = "Laptops & PCs")
    )

     

    It should be working like this:

    by default, all checkboxes are checked (show all items)

    when you uncheck checkbox "Mobile Devices", the mobile devices are not shown anymore.

    So, combinations are possible, i.e. only checkboxes "Periphery" and "Mobile Devices" are checked, then only the periphery and the mobile devices are shown in the gallery.

     

    Could you please give me some guidance here?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard