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
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.

Users online (2,809)