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

Filter gallery with multiple checkboxes

usingHello guys, how are you?

 

I am getting better improvement in Powerapps, but still having some difficulties to implement the right solution.

I have one gallery control from Sharepoint List, with a searchbox and 8 different checkboxes : I want to filter my gallery control according to checked check boxes.

My problem is :

If I select only one checkbox (that means checkbox1 =Engineering) then gallery should have only "Engineering" records and if I select 2 checkboxes (checkbox1 =Engineering and checkbox2 =Proposal), then the gallery would have Engineering and Proposal data and so on> if I have 5 checkboxes checked, I shall see 5 data in the gallery. but it is not working, only one data is displayed.

>>  what I want is to be able to have all data included in display regarding the number of checked check boxes.

Here is the formula that I have put in the items section of the gallery :

 

If(

CheckboxEngineering_1.Value; Search( Filter('TI Tools Library';Titre="Engineering"); ToolSearchBox3_1.Text; "Tool") ;
CheckboxDBOffice_1.Value; Search(Filter('TI Tools Library';Titre="DB Office"); ToolSearchBox3_1.Text; "Tool") ;
CheckboxConstructCommiss_1.Value; Search( Filter('TI Tools Library';Titre="Construction & Commissioning"); ToolSearchBox3_1.Text; "Tool") ;
CheckboxFinancePerformance_1.Value; Search(Filter('TI Tools Library';Titre="Finance & Performance"); ToolSearchBox3_1.Text; "Tool") ;
CheckboxMarketing_1.Value; Search(Filter('TI Tools Library';Titre="Marketing"); ToolSearchBox3_1.Text; "Tool") ;
CheckboxProposal_1.Value; Search(Filter('TI Tools Library';Titre="Proposal"); ToolSearchBox3_1.Text; "Tool") ;
CheckboxDTI_1.Value; Search(Filter('TI Tools Library';Titre="DTI"); ToolSearchBox3_1.Text; "Tool") ;
CheckboxSCPM_1.Value; Search( Filter('TI Tools Library';Titre="SCPM"); ToolSearchBox3_1.Text; "Tool") ;

Search('TI Tools Library'; ToolSearchBox3_1.Text; "Tool")

)

 

Besides, I have tried to do with CountIf but it doesn't work.

 

Please advise

Many thanks

3 REPLIES 3
Community Support Team
Community Support Team

Re: Filter gallery with multiple checkboxes

Hi @Mansoor88 ,

Do you want to filter items by using some checkboxes and a textinput?

Is Titre field and Tool field both text type?

If so, try this:

1)set checkboxes

set CheckboxEngineering_1's OnCheck:

Set(var1,true)

 set CheckboxEngineering_1's OnUncheck:

Set(var1,false)

set CheckboxDBOffice_1's OnCheck:

 

Set(var2,true)

 

 set CheckboxDBOffice_1's OnUncheck:

 

Set(var2,false)

 

.....

Please set 8 check boxes like these two check boxes. (set var1,var2,var3,var4,var5,var6,var7,var8)

2)set the gallery's Items:

If(IsBlank(ToolSearchBox3_1.Text),
   'TI Tools Library'),
   If((IsBlank(var1)&&IsBlank(var2)&&IsBlank(var3)&&IsBlank(var4)&&
       IsBlank(var5)&&IsBlank(var6)&&IsBlank(var7)&&IsBlank(var8))||
      (!var1&&!var2&&!var3&&!var4&&!var5&&!var6&&!var7&&!var8),
      Search('TI Tools Library', ToolSearchBox3_1.Text, "Tool"),
      Filter(Search('TI Tools Library',ToolSearchBox3_1.Text,"Tool"),
        If(var1,Title="Engineering")||If(var2,Title="DB Office")||If(var3,Title="Construction & Commissioning")|| If(var4,Title="Finance & Performance")||If(var5,Title="DMarketing")||If(var6,Title="Proposal")|| If(var7,Title="DTI")||If(var8,Title="SCPM")
              )
       )
)

Then, if there's no checkbox checked and there's no word in the textinput, the gallery will display all the items.

If there's no checkbox checked and there's word in the textinput, the gallery will filter data based on the textinput.

If there's checkbox checked, the gallery will filter based on the check boxes and the textinput.

What's more, I've noticed that you use ";" as "," in your region. So you may try these formulas:

Set(var1;true)
Set(var1;false)
If(IsBlank(ToolSearchBox3_1.Text);
   'TI Tools Library');
   If((IsBlank(var1)&&IsBlank(var2)&&IsBlank(var3)&&IsBlank(var4)&&
       IsBlank(var5)&&IsBlank(var6)&&IsBlank(var7)&&IsBlank(var8))||
      (!var1&&!var2&&!var3&&!var4&&!var5&&!var6&&!var7&&!var8);
      Search('TI Tools Library'; ToolSearchBox3_1.Text; "Tool");
      Filter(Search('TI Tools Library';ToolSearchBox3_1.Text;"Tool");
        If(var1;Title="Engineering")||If(var2;Title="DB Office")||If(var3;Title="Construction & Commissioning")|| If(var4;Title="Finance & Performance")||If(var5;Title="DMarketing")||If(var6;Title="Proposal")|| If(var7;Title="DTI")||If(var8;Title="SCPM")
              )
       )
)

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Mansoor88
Level: Powered On

Re: Filter gallery with multiple checkboxes

Hi @Phoebe Liu 

 

Thank you very for your help,

 

I tried to implement with your formula, by setting first the checkboxes (OnCheck & OnUncheck)

 

unfortunately, it is working.

 

Best regards, Mansoor88

Mansoor88
Level: Powered On

Re: Filter gallery with multiple checkboxes

Any other solution

 

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 (7,517)