My Power App has Collection1.
I have Gallery1 too.
I use the collection to track if all gallery checkboxes are checked so I can enable a button.
AgreeCheckbox in Gallery1 has the following actions:
OnCheck : Collect(Collection1, ThisItem)
OnUncheck : Remove(Collection1, ThisItem).
And then on the displaymode property of the button:
If(CountRows(Collection1) = CountRows(Gallery1.AllItems), DisplayMode.Edit, DisplayMode.Disabled)
I'm running the App in preview mode, but sometimes items get stuck in Collection1 and the button is enabled even if only half of the checkboxes are checked (I have 6 and 2 or 3 items get stuck).
I added OnStart: Clear(Collection1) to Screen1, but it didn't work.
What's wrong?
You can refer this below link
https://www.matthewdevaney.com/power-apps-multiple-selection-checkbox/