web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Setting multiple toggl...
Power Apps
Unanswered

Setting multiple toggles with a single toggle switch

(0) ShareShare
ReportReport
Posted on by 23

Hello,

 

I have a form with multiple toggles, and I would like to include a "toggle all" function where the user can change a single toggle to turn all the other toggles on or off simultaneously. 

 

Here's what I currently have -

On the master toggle:

OnCheck = Set(SelectedValue,"Yes");Set(ResetToggle,true)

 

OnUncheck = Set(ResetToggle,false)

 

On the slave toggles:

Reset = If(ResetToggle=true,false,true)

Default = Parent.Default

 

On the screen:

OnVisible = Set(SelectedValue,"");Set(ResetToggle,false)

 

The problem is, this seems to only set the slave toggles in one direction. I essentially want them to just follow the status of the master toggle, when it is moved, but then still allow for independent control of each individual toggle.

 

Any help is appreciated.

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @AcesOverPacific 

    Hi there!  I think the 1st step would be to ensure each time the master toggle is changed would be to turn the ResetToggle variable on & off as opposed to just one direction.  Let me know if this solves the issue.

     

    On the master toggle:

    OnCheck = Set(SelectedValue,"Yes");
    Set(ResetToggle,true); Set(ResetToggle,false);

     

    OnUncheck =  Set(ResetToggle,true); Set(ResetToggle,false)

     

    On the slave toggles:

    Reset = ResetToggle

    Default = Parent.Default

     

    On the screen:

    OnVisible = Set(SelectedValue,"");Set(ResetToggle,false)

     

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • eka24 Profile Picture
    20,925 on at

    You can use a variable is OnVisible of the screen;

    UpdateContext({OffToggle:!OffToggle})

     

    Then insert a button to turn the Toggle on or off. OnSelect of the button put:

    UpdateContext({OffToggle:!OffToggle})

    When you select the button, it will turn true and false.

     

    On the Default of each Toggle put:

    OffToggle

     

    ------------
    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

     

  • AcesOverPacific Profile Picture
    23 on at

    Hello, 

     

    Thanks for your recommendations. After implementing them, I now see no movement on the slave toggles at all when I move the master toggle. All formulas are accepted as valid, but no action occurs.

     

    Thanks

  • AcesOverPacific Profile Picture
    23 on at

    @eka24  Your solution does work, the only problem is it loses my ability to default to the parent item when opening an existing form. For example, if one toggle was previously saved in the off position, when I open that form in edit mode that toggle now automatically changes to on. Is there a way to do this, and keep "Parent.Default" functionality?

  • eka24 Profile Picture
    20,925 on at

    You can adjust the formula on Defaults aa.:

    If(Form1.Mode=FormMode.Edit,Parent.Default,OffToggle)

     

    Please change the name of the form to your actual form name

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Jltitus Profile Picture
    138 on at

    How would this work if you were using galleries and having the OnToggle patch a yes value to a SharePoint list? 

     

    I'd like to have a master toggle in each gallery that the user can select to flip all the toggles to "yes" and then be able to flip only those needed back to "no" before writing back to the SharePoint list.

     

    I have an app where I have multiple galleries (gallery 1, gallery 2, gallery 3) where I'm using a Toggle.

     

    Default for the toggle is:

    If(ThisItem.FDAApproved=true, true,false)

    OnSelect the toggle patches back to the Applicants List_1

    Patch(
     'Applicants List_1',
     LookUp('Applicants List_1',ID=ThisItem.ID),
     {
     FDAApproved:If(
     AccelerateApproveToggle.Value=true,
     true,
     false
     )
     }
    )

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 234 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard