cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pagliaci
Frequent Visitor

Toggle in a gallery

I am trying to build a gallery with toggles and a submit button, where I want to save my data on share point only if all the toggles are answered "yes" ... how do I apply this "if" to all my toggles and not just the first one?

1 ACCEPTED SOLUTION

Accepted Solutions
RonLar
Advocate II
Advocate II

Hello @pagliaci,

 

This formula will return 0 when all of the toggles are "On":

 

CountRows(Filter(Gallery1.AllItems,Not(Toggle1.Value)))

 

 

You could set the DisplayMode property in the Submit Button to something like this:

 

If(
    CountRows(
        Filter(
            Gallery1.AllItems,
            Not(Toggle1.Value)
        )
    ) > 0,
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 

This will disable the button unless all toggles are turned on.

 

Example:

RonLar_0-1629817815988.png

RonLar_1-1629817837652.png

Hope that helps.

 

Please  RonLar_2-1629817935012.png if this solves your problem.

 

-Ron

 

View solution in original post

2 REPLIES 2
RonLar
Advocate II
Advocate II

Hello @pagliaci,

 

This formula will return 0 when all of the toggles are "On":

 

CountRows(Filter(Gallery1.AllItems,Not(Toggle1.Value)))

 

 

You could set the DisplayMode property in the Submit Button to something like this:

 

If(
    CountRows(
        Filter(
            Gallery1.AllItems,
            Not(Toggle1.Value)
        )
    ) > 0,
    DisplayMode.Disabled,
    DisplayMode.Edit
)

 

This will disable the button unless all toggles are turned on.

 

Example:

RonLar_0-1629817815988.png

RonLar_1-1629817837652.png

Hope that helps.

 

Please  RonLar_2-1629817935012.png if this solves your problem.

 

-Ron

 

pagliaci
Frequent Visitor

Thank you so much!!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (3,306)