cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fastlanestrange
Level: Powered On

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
PowerApps Staff CarlosFigueira
PowerApps Staff

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
PowerApps Staff CarlosFigueira
PowerApps Staff

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

fastlanestrange
Level: Powered On

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

JRaasumaa
Level 10

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)

fastlanestrange
Level: Powered On

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.

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?

pol1033
Level: Powered On

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.

 

kcu07jp2
Level: Powered On

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?

josiahk
Level: Powered On

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
osflake
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 319 members 5,889 guests
Please welcome our newest community members: