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 / using multiple toggles
Power Apps
Answered

using multiple toggles

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have 3 toggles

 

Toggle1

Togge2

Toggle3

 

I want to be able to move toggle2 & toggle3 to false every time I "oncheck" toggle1.

 

I currently have

Toggle1 OnCheck to Set(Toggle2, false)

 

And toggle2 default is set to Toggle2

 

It works the first time, but if I randomly flip the toggles around, it stops working. 

 

How do I write it so that it will always flip Toggle2 back to false every time I toggle1 to true. 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @morall 

    make the default of Toggle2: !Toggle1.Value

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @morall 

    Consider setting the Default property of Toggle2 and Toggle3 to false.

    Then set the Reset property of Toggle2 and Toggle3 to Toggle1.Value

     

    You can get rid of the OnCheck actions and variables.

     

    I hope this is helpful for you.

     

  • morall Profile Picture
    Microsoft Employee on at

    I was trying to learn more about what the reset property did, but the documentation didn't say that much. Can you give a laymen explanation? (ie - a sentence or two)

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @morall 

    Reset is a true/false value that tells the control to reset to default.

     

    In your scenario, you are setting the Reset to the value of the Toggle1.  Therefore, when you set Toggle1 On/true.  The other Toggles will then Reset.

     

  • morall Profile Picture
    Microsoft Employee on at

    Ok, I see what it does, however I have created circular logic.

     

    I'm getting an error when I do this

     

    reset Value of Toggle1: Toggle2.Value

    reset Value of Toggle2: Toggle1.Value

     

    I'd like to make it so that when:

     

    This is why I was thinking of doing OnCheck, make the value of every other toggle false

     

    Toggle1 is Yes

    toggle2 & Toggle3 are set to No

     

    When Toggle2 is Yes

    Toggle1&Toggle3 are set to No

     

    ..etc

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    wrong.gif

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @morall 

    You do not set the Reset of Toggle1 only Toggle2 and Toggle3

    Your original requirement was that if Toggle1 was turned on, you wanted all the others to go false.

     

    Are you stating your requirement is different?

     

    Yes, if you do what you were trying there, you will have circular logic...not allowed!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Drrickryp 

    FAVORITE!!!!!!!!!!!!!  😀

  • morall Profile Picture
    Microsoft Employee on at

    Yes. Solving it the way you recommended worked, but then I realized it didn't solve the full problem

     

    For example filtering a list of people in a Gallery:

     

    Toggle1: Filter list of people with "interest"

    Toggle2: Filter list of people "without interest"

     

    I don't want to let users be able to toggle both to be true. I would like it so that Toggle1 will always turn off Toggle2 and vice versa. However, they can both be off and users can see everyone.

     

    I saw someone else trying to do the same thing with UpdateContext() but I couldn't get it to work. 

     

    Any thoughts? 

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @morall 

    You know...the first thought that comes to mind is hmmm, that's a little over complicating a simple situation.  Reason...because the Radio control would be a much better pick for this situation.

     

    Have you considered that instead?

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 337 Most Valuable Professional

#2
11manish Profile Picture

11manish 173

#3
Valantis Profile Picture

Valantis 86

Last 30 days Overall leaderboard