Hi All,
I have a setup whereby my checkboxes display mode is disabled when one value is selected. When the user goes to edit the form, the unselected values should remain disabled (Please see Figure 1 below). It's a method I got from Daniel Christian's Power Apps: Limit number of checkbox selections in a gallery
Now I have noticed the method does not work for some odd reason, Probably due to the PowerApps updates 🤔. When a User re-enters the form to edit the form. The disabled values somehow become available, even though there's one opposing value still in the collection. Which should limit the user’s choice of selection. (Please see Figure 2 below)
I carried my own test and I noticed, when I choose any other checkbox other than the first checkbox, the default property of the checkbox is off/False and I do not understand why? Because the Checkbox text property is ThisItem.Value and the default property is ThisItem.Value in colContractUsed.Value. This should make the default property True and should remain True after submission, because it is a selected value that is in the collection. (Please see Figure 3 below). Please can anyone help with a solution, as this has disrupted the functionality of my other apps as well.
Thank you in advance.
Teddy.
Images:
Figure 1: How it's supposed to work
Figure1: How it is suppose to work
Figure 2: When the User Re-enters the form. All Checkboxes become available for selection. Instead of only One being available and the rest disabled
When the User Re-enters the form. All Checkboxes become available for selection. Instead of only One being available and the rest disabled
Figure 3: The test noticed the default property remains Off instead of staying On. Unless the selected value is not the first checkbox.
Figure 3: The test notice the default property remains Off . if the selected value is not the first checkbox
Here are my code settings:
Data card settings:
Default:
ThisItem.'What form of contract will be used'
Update:
First(colContractUsed)
Gallery Setting:
Items:
Choices([@'Approval To Let Test'].'What form of contract will be used')
Checkbox Settings:
Text:
ThisItem.Value
Oncheck:
Collect(colContractUsed,ThisItem.Value);
OnUncheck:
RemoveIf(colContractUsed,Value=ThisItem.Value);
Default:
ThisItem.Value in colContractUsed.Value
Display mode:
If(Self.Value||(Value(GLB_6.Text)=0),DisplayMode.Edit,DisplayMode.Disabled)
Label Settings:
Text:
CountRows(Filter(Gallery6.AllItems,Checkbox6.Value))