cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gvantsatt
Regular Visitor

Filter gallery items (from a SharePoint list) with a multi-select checkbox

Hi everyone,

I have a gallery from a SharePoint list called "All OKRs" and all I'm trying to do is filter the gallery by using  the checkboxes below (user can select either one box or multiple boxes). Basically, if a user selects CompanyCheckbox the gallery should filter the "ALL OKRs" list where  OKR Type is Company. If user selects CompanyCheckbox and ECMChecbox it should filter by both selections etc. ("OKR type" is a drop-down option In "All OKRs list" that is not multi-select). My function is not working and I am new to PowerApps and have been struggling with this issue for a long time. Any help would be appreciated.

 

If(CompanyCheckbox.Value=true && ECMPracticeCheckbox.Value=false, Filter('All OKRs', 'OKR Type'= "Company"))checkboxcheckbox

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @gvantsatt ,

You are selecting items in a gallery - I will call it DiscoverOKRs (change this to your gallery name)

If(
   DiscoverOKRs.Selected.CompanyCheckbox.Value=true && 
   DiscoverOKRs.Selected.ECMPracticeCheckbox.Value=false, 
   Filter(
      'All OKRs', 
      'OKR Type'= "Company"
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @gvantsatt ,

Answer below is for one selected item - I see you can select many.

What is the Items property of the gallery?

Thank you for your response @WarrenBelz . I tried the function and it didn't work. Is it because I have to apply the function to all  the checkboxes? 

The Items property on the gallery is "All OKRs" which is the SharePoint list the data is coming from

OK Thanks @gvantsatt ,

Is the checkbox liked to a field in 'All OKRs' or is it unbound. Also what is its name?

v-siky-msft
Community Support
Community Support

Hi @gvantsatt 

 

You have to apply the Filter function to Gallery Items property. Since "OKR type" is Choices type column, we need to use 'OKR Type'.Value code to reference that field.

Please modify the Items property as below:

 

If(CompanyCheckbox.Value=true && ECMPracticeCheckbox.Value=false, Filter('All OKRs', 'OKR Type'.Value= "Company"))

 

Sik

 

@WarrenBelz  the checkboxes are supposed to be linked to two columns in All OKRs list. 

 

1.Column Name= "OKR Type" (Company, Practice Type, Individual)

2.Column Name= "Practice Type" (ECM, …)

 

if company checkbox Is selected, the All OKRs list should be filtered by OKR Type= Company 

if ECM checkbox is selected, All OKRs list should be filtered by "OKR Type"=Practice AND "Practice Type"=ECM

if Individual checkbox is selected, All OKRs list should be filtered by "OKR Type=Individual"

if ALL checkbox is selected, it should display everything

 

if more than one checkbox is selected, the gallery should be filtered accordingly (if this is too complicated, it can be single select instead of multi-select) 

Hi @gvantsatt ,

Try the below

If(
   AllCheckbox.Value=true,
   'All OKRs', 
   CompanyCheckbox.Value=true,
   Filter(
      'All OKRs', 
      'OKR Type'.Value= "Company"
    ),
    ECMheckbox.Value=true,
    Filter(
      'All OKRs', 
      'OKR Type'.Value="Practice" &&
      'Practice Type'.Value="ECM"
    ),
    IndividualCheckbox.Value=true,
     Filter(
      'All OKRs', 
      'OKR Type'.Value="Individual"
    )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,953)