cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lana
Helper II
Helper II

Dynamic tabs based on checkbox selection

Hi,

I have a gallery which generates the tabs effects like below. Can I derive the gallery tabs based on checkbox selection?

 

If I select tab1 checkbox & tab2 checkbox I have to show only two tabs(tab1 & tab2). I know its a lot of combinations to check.

Lana_0-1640310468313.png

Wondering if anyone has an any suggestions or alternatives to my scenario?

 

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @Lana ,

Something like the below?

CheckMenu.gif

The Items of the bottom horizontal gallery is

With(
   {
      wTable:["tab1","tab2","tab3","tab4"],
      wChecks:[If(ckTab1.Value,"tab1"),If(ckTab2.Value,"tab2"),If(ckTab3.Value,"tab3"),If(ckTab4.Value,"tab4")]
   },
   Filter(
      wTable,
      Value in wChecks.Value
    )
)

The check boxes are names ckTab1-4

The Text of the Label in the gallery is 

ThisItem.Value

 

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.

Visit my blog Practical Power Apps

 

View solution in original post

3 REPLIES 3
WarrenBelz
Super User
Super User

Hi @Lana ,

Something like the below?

CheckMenu.gif

The Items of the bottom horizontal gallery is

With(
   {
      wTable:["tab1","tab2","tab3","tab4"],
      wChecks:[If(ckTab1.Value,"tab1"),If(ckTab2.Value,"tab2"),If(ckTab3.Value,"tab3"),If(ckTab4.Value,"tab4")]
   },
   Filter(
      wTable,
      Value in wChecks.Value
    )
)

The check boxes are names ckTab1-4

The Text of the Label in the gallery is 

ThisItem.Value

 

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.

Visit my blog Practical Power Apps

 

Ethan_R
Super User
Super User

Hi @Lana ,

 

I would recommend trying the visible property on the button within gallery.

Write the below code in Visible property as,

 

If(Checkbox1, true, false)

 

 

You will only see those buttons for which that specific checkbox is selected.

Output below,

Ethan_R_0-1640316259711.png

Or 

you can use another gallery as

Filter(Gallery1.AllItems, Checkbox1.Value = true)

Ethan_R_0-1640316667435.png

 

Hope this helps.

This is exactly what I was looking for.. Thank you so much!!

 

Sorry for the late reply.

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 (2,943)