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 / Automatic toggle won't...
Power Apps
Answered

Automatic toggle won't reset back to default

(0) ShareShare
ReportReport
Posted on by 18

Hello,

 

I made a form with manual checkboxes and a automatic toggle.

 

The idea of the form is:

user_109_1-1636369768882.png

 

The checkboxes are checked/unchecked manually

The toggle will change automatically if all the checkboxes are checked

The user shouldn't be able to change the toggle

 

This works but the toggle doesn't change back if a checkbox is unchecked

 

I use a variable to set Toggle1.Default

The checkboxes are based on a Excel document, with the LookUp function

 

(side question: how to I make the toggle unclickable for the user?

Displaymode.View makes the toggle disappear..)

Categories:
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    What is the formula you are using to set your variable.   Also have you tried DisplayMode.Disabled rather than DisplayMode.View?

  • PTBBSolutions Profile Picture
    691 on at

    Hi @user_109 ,

     

    In 1st checkbox, set the variable for both check and uncheck to change - e.g. OnCheck: Set(Op1, true) and OnUncheck: Set(Op1, false).


    Do the same for checkbox 2 but with a different variable name - e.g. OnCheck Set(Op2, true) and OnUncheck: Set(Op2, false).

     

    After that set the default property of you toggle to Op1 And Op2.

     

    Change your DisplayMode to Disabled sso your toggle will be vissible but not editable.

     

    Please let me know if this helps.

  • user_109 Profile Picture
    18 on at

    I've set a variable for OnChange and OnUnchange

    I've set the default of the toggle to: varCheck1 & varCheck 2

     

    But the toggle already changes if Checkbox 1 is selected and Checkbox 2 is still unchecked

    Which formula can I use to correct this?

     

    The displaymode works now, thanks!

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at
    If(
     varCheck1 && varCheck2, true,
     false
    )
  • Verified answer
    PTBBSolutions Profile Picture
    691 on at

    @user_109 This should be already working. I've tested it with sample data and works properly:

     

    1) CheckBox1

     

    PTBBSolutions_0-1636373687967.png

    2) CheckBox2

    PTBBSolutions_1-1636373726258.png

    3) Toggle control:

    PTBBSolutions_2-1636373768556.png

     

  • user_109 Profile Picture
    18 on at

    Thanks @PTBBSolutions & @JR-BejeweledOne 

    I forgot that I needed to use the &&

     

    Thank you!

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 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard