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 Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Top Solution Authors
Users online (1,837)