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

On check only a single check box in a gallery making all other checkbox inactive.

Can we on check only one check box instead of multicheck boxes in a gallery which is having number of checkboxes. When, on chekc a checkbox, gallery should not allow to on check another check box. I just want to send only one check box data to my table. Can anybody help on this?

1 ACCEPTED SOLUTION

Accepted Solutions
Rebetcha
Level 10

Re: On check only a single check box in a gallery making all other checkbox inactive.

In the attached screenshot you will find the basic concepts of the solution explained including the most important formulas.

View solution in original post

13 REPLIES 13
Rebetcha
Level 10

Re: On check only a single check box in a gallery making all other checkbox inactive.

Can you add some screenshots to clarify your question? Thank you.
mg_n
Level: Powered On

Re: On check only a single check box in a gallery making all other checkbox inactive.

Arrow shows my gallery. When i on check one check box the other should be inactive( which means i should not able to on check other check boxes). 

Rebetcha
Level 10

Re: On check only a single check box in a gallery making all other checkbox inactive.

There is no good solution doing this using the gallery control. The only option you have is to set a variable on the OnCheck property of the checkbox. Than use that variable in een If-statement on the Displaymode variable of the checkbox to disable it. But that means that after checking 1 checkbox you will not be able to deselect it and select another one since all the in a gallery checkboxes share the samen formulas.
mg_n
Level: Powered On

Re: On check only a single check box in a gallery making all other checkbox inactive.

Thank you for the reply. But that doesn't serve my purpose. Is there any alternative you have?? 

Rebetcha
Level 10

Re: On check only a single check box in a gallery making all other checkbox inactive.

Couple of options:

  1. You could use a combo box or drop down instead of the gallery with check boxes(set to SelectMultiple=false)
  2. You could at to the number of check boxes you need instead of the galery. You can then configure OnCheck of each check box to set a variable to true and OnUncheck to set this variable to false. In the Displaymode-property of each check box you ad a function that says if the chec box is unchecked and the variable is set to true (that means another check box is checked) Displaymode.Disabled, otherwise Displaymode.Edit. 
mg_n
Level: Powered On

Re: On check only a single check box in a gallery making all other checkbox inactive.

I have done this to my other fileds which are not in gallery. But they wont uncheck on the refreshing of the screen. The last oncheck box will be marked oncheck only. On refresh of the screen or sending data to table, all checkboxes default property should be uncheck. 

Rebetcha
Level 10

Re: On check only a single check box in a gallery making all other checkbox inactive.

Hi @mg_n, there are 2 ways to make this happen. You could either use the Reset-function or toggle the Reset property of the check box controls based on an action in your app. 

In your case the quickest way probably is to toggle the Reset property. My guess is you have some icon or button you press to save data or navigate away from the screen. If you use a button, you can add <buttonname>.pressed to the reset properties of all check boxes. If you use icons you will have to set a variable to toggle the reset property between true and false.

If you want to use the Reset function you add Reset(<Checboxname>) for each check box to the OnHidden property of the screen that contains the check boxes and in the same property where tou put the formula that sends data to table. 

 

More info:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-reset

mg_n
Level: Powered On

Re: On check only a single check box in a gallery making all other checkbox inactive.

Hi Rebetcha,

 

You got my problem exactly. I have tried this soultion before writing here. Checkboxes will reset after the button is pressed but i am not able to oncheck other checkboxes until unless i oncheck and uncheck the previous checkbox which was reset. If i do that, i can oncheck any of my checkboxes.

Rebetcha
Level 10

Re: On check only a single check box in a gallery making all other checkbox inactive.

If you added a variable that sets the displaymode of the checkboxes as discussed earlier in this thread, you have to also set this variable to 'false' in the same action. In that way in one move you reset all the check boxes and make them all checkable (is that a word 😉 ) again.

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 (Last 30 Days)
Users online (4,898)