Just started and have a form to make with a lot of questions that contain 3 checkboxes each.
As the user can only select one of the boxes for each question and the forms text generated is decided by which boxes they ticked, how can I make it so the ticking of one box immediately unticks the other 2 in that question sector so the user doesn't have to tick and then untick it to tick another or forgets to which messes up the form?
I tried editting the OnCheck part of "checkbox a" to say "checkbox b".Value = false but that didn't work. I also tried editing the reset part to be if("checkbox x".Value = true, true) so that it reset if another was ticked, which worked until I did it for all 3 of them and I got an error saying you can't refer to a value dependant on your value.
Anyone know how I could achieve this?
Solved! Go to Solution.
Hi
I hope I understand what you want:
Create 3 CheckBox, with Survey Questions. set:
- each CheckBox.Default with a context variable
- each CheckBox.OnCheck = UpdateContext({....}); UpdateContext({...}) in PAIR (it is a must).
Look at my example as attached (screenshot), and it will definitely work.
In fact, if you are OK, why not use ListBox which allow SelectMultiple = False and you can get it done more easily.
Hope this helps.
Have a nice day.
Hi
I hope I understand what you want:
Create 3 CheckBox, with Survey Questions. set:
- each CheckBox.Default with a context variable
- each CheckBox.OnCheck = UpdateContext({....}); UpdateContext({...}) in PAIR (it is a must).
Look at my example as attached (screenshot), and it will definitely work.
In fact, if you are OK, why not use ListBox which allow SelectMultiple = False and you can get it done more easily.
Hope this helps.
Have a nice day.
How would I do this if all checkboxes were in a gallery? How would I reference another checkbox in a gallery?
Did you figure out the Gallery piece? I'm having a similar issue:
Scenario:
Thoughts on this one?
Checkbox 1 is xval1, checkbox 2 xval2, checkbox 3 xval3. The picture shows all as xval1. Everything else is correct, thank you for your example.
Hello,
I know it's almost an year late to repond to this question(Related to ericonline post) but maybe this will help others coming across your post.
For the scenario that you have a Checkbox outside of a Gallery lets call it "Select All", and you want to use it to select all items from the Gallery that has a Checkbox placed in called "Checkbox1" ( *and add them to a colection called "SelectItems") :
For the Gallery in my case i have only 2 items Name and File:
-Name.Text=Label for Name in Gallery
-DisplayFileName.Text= Label for File in Gallery
Set up as it follows:
1.SelectAll Checkbox outside Gallery:
OnCheck: ForAll(Gallery.AllItems, Collect(SelectItems, {Name: Name.Text, File: DisplayFileName.Text}))
OnUncheck: Clear(SelectItems)
2.Checkbox1 placed in Gallery:
OnCheck: Collect(SelectItems, {Name: Label2.Text, File: DisplayFileName.Text})
OnUncheck: Clear(SelectItems)
Default: SelectAll.Value
To test that it collects all selected checkboxes, I created a Blank Vertical Gallery and set its Items property to : SelectItems, and add 2 labels for Name and File, and set up for each on the Text property: ThisItem.File for the File label, and ThisItem.Name for the Name label.
Hope it helps! 🙂
Hey All,
I think I have found an easier way of doing this. I have 2 checkboxes. CHK1 & CHK2.
CHK1.OnCheck = reset(CHK2)
CHK2.OnCheck = reset(CHK1)
Seems to work OK for me.
Same issue. Did you find any solution?
Hi @AlisterT from what I understand, that will uncheck checked checkboxes. How do you check a checkbox with another checkbox.
The Reset function resets a control to its Default property value. The Check box is a Boolean value which is set to true or false.
What would be the PowerApps equivalent of true as is Reset is to false?
User | Count |
---|---|
125 | |
87 | |
87 | |
75 | |
69 |
User | Count |
---|---|
215 | |
181 | |
140 | |
97 | |
83 |