cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JHS2020
Helper V
Helper V

Filter based on multiple checkboxes

Hi

 

I have an app, where I have 10 checkboxes I need to filter the information on. It result in a lot of combinations, as multiple check boxes could be selected at once. How do I solve this, as the gallery will not display more code after 50, as it states Limitation for Nested Function 

 

JHS2020_0-1642684597180.png

 

6 REPLIES 6
rubin_boer
Super User
Super User

hi @JHS2020 

 

I'm sure there are a few ways to do this, I will share one.

 

Result 

multi check options.gif

 

 

Method

  • Add gallery for checkboxes Items = ["Option A", "Option B", etc ] or something similar
    • ForAll(Sequence(10,1),{name: "Option " & Char(Value + 64)}) // as an example 
  • Add checkbox to gallery and add all the selected checkboxes to a string variable options
    • OnSelect = UpdateContext({options:Concat(Filter(Gallery16.AllItems,yourCheckBox.Value),name,",")})
  • add another filter to display the selected item
  • set Items = Filter(yourDataSource, yourfilterColumn in yourVariableFromOptionGallery)
    • Filter(ForAll(Sequence(100,1),{option: "Option " & Char(RandBetween(64,74)), name: "some name ... " & Value}),option in options) //from the example

That should do it

 

Hope it helps,

R

How is your data column in sharepoint. I am trying to get this to work

  • Filter(ForAll(Sequence(100,1),{option: "Option " & Char(RandBetween(64,74)), name: "some name ... " & Value}),option in options) //from the example

However I cannot seem to get it to work, as my options is made by a choice column?

JHS2020
Helper V
Helper V

I have added this, but it does not seem to work

 

ForAll(Categories,{name: Title}) // on the gallery

 

UpdateContext({MySharePointList:Concat(Filter(option.AllItems,Checkbox13.Value),Title1.Text)}) //For the checkbox

 

Filter(MySharePointList, Title1 in Category1) // Items on the gallery

rubin_boer
Super User
Super User

hi @JHS2020 

in your case:

Selection Gallery (galSelect)

  • Items = Categories 
  • Add Checkbox (chkSelect) and its Text = ThisItem.Title
    • UpdateContext({options:Concat(Filter(galSelect.AllItems,chkSelect.Value),ThisItem.Title,",")})

Display Gallery

  • Items = Filter(Categories, Title in options)
  • add label Text = ThisItem.Title

 

Please try this.

JHS2020
Helper V
Helper V

Is it not possible to use one sharepoint list to filter the selection gallery and the display gallery should be another sharepoint list? 

JHS2020_0-1643092329763.png

 

It is like it is not working with the variables as it takes the latest check again 

JHS2020_1-1643093315845.png

JHS2020_2-1643093362273.png

 

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,863)