Reputation: 1
I have added a list of checkboxes in the PowerApps gallery. I want to prevent the user from selecting more than one checkbox. If condition is an option but it's not suitable for my scenario as the list of checkboxes is dynamic. The checkboxes can increase or decrease anytime based on events. Please suggest if there is any possible solution for this.
Upvotes: 0
Views: 2158
Reputation: 7
I've made it the following way:
Place on the Checkbox in the Gallery (named galFStation in the Example)
OnCheck: Set(sFilterStation;galFStation.Selected.Bezeichnung)
Default: sFilterStation = ThisItem.Bezeichnung
DisplayMode: If(sFilterStation = ThisItem.Bezeichnung; DisplayMode.View; DisplayMode.Edit)
So you prevent from deselecting the selected one and you only one can be selected.
Upvotes: 0
Reputation: 1
I'm was also looking for a solution to this. Despite setting DisplayMode.Disable upon the "OnCheck" action of one, the boxes are still able to be checked even though displayed as disabled. To address it, I made a condition on the gallery itself, where property 'selectable' is on the condition of whether the checkbox is checked (value=true).
Upvotes: 0