cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Checkboxes check/uncheck other checkboxes

Hello,

 

I have created an app where the user steps through several canvases and selects from a set of checkboxes. On this particular canvas, if someone selects CBSSC Staff, I need the app to automatically select CBS GAL as well. Unchecking CBSSC Staff would also uncheck CBS GAL. It should not work in the other direction, however...if someone selects CBS GAL, that checkbox would be the only one that is supposed to be checked.

 

Basically, all CBSSC Staff includes CBS GAL, but not all CBS GAL includes CBSSC Staff.

 

Is there a way to make a checkbox simultaneously check another box? I've tried various "OnCheck" things but nothing is actually making CBS GAL check when I check CBSSC Staff.

 

Daniel

 

app_snip.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Power Apps
Power Apps

Re: Checkboxes check/uncheck other checkboxes

If you set the Default property of the "CBS GAL" checkbox to CBSSCStaffCheckbox.Value, then every time a user checks/unchecks the CBSSC Staff checkbox, then the CSB GAL checkbox will be also checked/unchecked.

View solution in original post

11 REPLIES 11
Highlighted
Power Apps
Power Apps

Re: Checkboxes check/uncheck other checkboxes

If you set the Default property of the "CBS GAL" checkbox to CBSSCStaffCheckbox.Value, then every time a user checks/unchecks the CBSSC Staff checkbox, then the CSB GAL checkbox will be also checked/unchecked.

View solution in original post

Highlighted
Frequent Visitor

Re: Checkboxes check/uncheck other checkboxes

Amazing! I'm still new to PowerApps and can't tell you how much I appreciate you guys and gals who don't mind lending a hand to us noobs around here.

Thank you Carlos!

Daniel

Highlighted
Memorable Member
Memorable Member

Re: Checkboxes check/uncheck other checkboxes


@CarlosFigueira wrote:

If you set the Default property of the "CBS GAL" checkbox to CBSSCStaffCheckbox.Value, then every time a user checks/unchecks the CBSSC Staff checkbox, then the CSB GAL checkbox will be also checked/unchecked.


This works great!

 

You can also use an UpdateContext({CheckboxVar1:true}) type of an update for complex checkbox flipping.

 

For example if you had multiple checkboxes you can make it so OnCheck changes values of any checkbox variable you want with an UpdateContext and then put the CheckboxVar1 into the other item's defaults to flip flop them as needed. This works great for multiple checkbox scenarios and allows you to control each individually. (Reverse the flipping in the OnUnCheck property)

Highlighted
Frequent Visitor

Re: Checkboxes check/uncheck other checkboxes

Also awesome! I've messed around with variables a bit but not in this way, so I'll give this a try JRaasumaa.

Thanks a lot for the info and for the help.

Highlighted
Super User
Super User

Re: Checkboxes check/uncheck other checkboxes

Hm. I'm unable to Check a box in a Gallery with this method. 

 

Scenario: 

  • "SelectAll" Checkbox outside Gallery
  • Checkbox1 placed in Gallery
  • Checkbox1 OnCheck property set to ClearCollect(selectedItems, ThisItem)
  • Checkbox1 Default property set to selectAll_Checkbox.Value
  • Checking Checkbox1 adds it to the selectedItems Gallery, no problem.
  • Checking selectAll_Checkbox puts a check in all the Checkboxes in the Gallery, but they are not added to the selectedItems Collection. 

Thoughts on this one?

Highlighted
Frequent Visitor

Re: Checkboxes check/uncheck other checkboxes

I struggled with checking a checkbox with a button "On Select", until I came accross this solution. I did not have to modify the code, I created a variable as suggested and then placed the variable in the checkbox default value and  Wa - La!

It worked perfectly. Now,  I just need to add code to check only the checkboxs of selected records.

 

Thank you.

 

Highlighted
Anonymous
Not applicable

Re: Checkboxes check/uncheck other checkboxes

I have followed the instructions here to select all of my checkboxes...which works...but the formula i have in the checkboxes (to patch) does not trigger when i select all using the select all checkbox...

 

Can anyone help?

Highlighted
Advocate I
Advocate I

Re: Checkboxes check/uncheck other checkboxes

I'm running into this same problem. Spent quite a bit of time searching around and haven't come across a solution. Anyone know how this can be accomplished? 

Highlighted
Frequent Visitor

Re: Checkboxes check/uncheck other checkboxes

I have the same problem..

when I check SELECTALL, checkbox1 is checked but not add all to collect..

 

is there any microsoft specialist from MS?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,040)