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 IV
Advocate IV

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 IV
Advocate IV

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 Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,720)