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

Community site session details

Session Id : QryKrQtJfNm8Yr1LIZKLAL
Power Apps - Building Power Apps
Answered

Checkboxes - activate one at a time, not both, how?

Like (0) ShareShare
ReportReport
Posted on 8 Apr 2021 08:25:52 by 775

Hello together,

 

I am relatively new here... I am looking for a way to set the control boxes so that when one is activated, the other can not be activated, that is, that only "YES" or only "NO" can be checked, not both. How can this be set? (See picture)

 

image.png

 

I am grateful for any help.

 

Best regards

I have the same question (0)
  • Suggested answer
    Remhk303 Profile Picture
    2 on 25 Feb 2025 at 02:14:49
    Checkboxes - activate one at a time, not both, how?
    Easiest way I found is as follows:
    1. For the OnCheck property of the checkbox, write a ClearCollect function, followed by a Reset function to reset the checkbox.
    • ClearCollect(colSingleCheckbox, ThisItem.Value);
    • Reset(Checkbox);
    2. For the Default property of that same checkbox, enter the following:
    • ThisItem.Value in colSingleCheckbox
    What that'll do is create kind of a circular logic type deal where every time you check a new box, it'll clear collect the selected value and then use that value as the default for when the checkbox gets reset. It works for me so give it a try.
     
  • Verified answer
    v-xiaochen-msft Profile Picture
    on 09 Apr 2021 at 03:13:36
    Re: Checkboxes - activate one at a time, not both, how?

    Hi @PowerSäm ,

     

    1\ Add a check box control 'Checkbox1' and set its Default property to:

    false

     

    Set 'Checkbox1' 's OnCheck property to:

    Reset(Checkbox2)

     

    2\ Add a check box control 'Checkbox2' and set its Default property to:

    false

     

    Set 'Checkbox2' 's OnCheck property to:

    Reset(Checkbox1)

     

    3\ The result is as follows:

    AAA.gif

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

  • Elias-V Profile Picture
    88 on 08 Apr 2021 at 08:54:53
    Re: Checkboxes - activate one at a time, not both, how?

    Hi PowerSäm,

    it depends what behaviour you want your application to have. Would you prefer if the checkbox was clickable but automatically removed the check on the other checkbox, or rather that you can't check it.

     

    Either way you could put checks on the OnCheck/OnUncheck actions.

    For example if you want it to be uncheckable; in both checkboxes' OnCheck:

    If(otherCheckbox.Value, false, true)

     

    and if you want it to take override the other checkbox I think you'll need a variable to keep track for example something like 

    in the screen OnVisible you Set(varCheckboxOn1, false); Set(varCheckboxOn2, false);

    checkbox1 Default: varCheckboxOn1

    checkbox2 Default: varCheckboxOn2

    and then on the OnCheck and OnUncheck action in both checkboxes you can adjust them however you want

     

     

    Hope this helps

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete