Announcements
I have a gallery with a checkbox. The gallery receives the number of checkboxes based on the number of choices from a SP list as well as those names from the choices in the SP list. I have it setup when a checkbox is selected it adds to a collection and when unchecked it removes it from the collection. I want the checkboxes to all be checked and have populated the collection at app start up. I tried setting the default value to true which makes all the checkboxes checked. Then for the collection to be prepopulated I typed ClearCollect(colChkRef,["Section Corners", "Lot/Block Corners", "Additional Information"]); in the Apps Onstart. however when I uncheck the box it does not remove the value from the collection. It only adds a new one and then removes that new one.
Hi @colbyturybury ,
Would please the onCheck and onUncheck property of checkbox ? It seems when you are collection the values on start it is getting collected to a different column.
The onCheck says: Collect(colChkRef, ThisItem)
The OnUncheck says: Remove(colChkRef, ThisItem)
When starting the app the collections looks like this.
When unchecking then rechecking it looks like this.
It never removes what was placed in the collection from the App Start.
Use this formula for OnUncheck property of your checkbox:
RemoveIf(colChkRef, Value=ThisItem.Value)
Best regards,
Allen
Perfect! Thank you. Simple copy and paste. Would you mind explaining it to me?
This is because RemoveIf function will find then remove all the matched records(records with same value), however Remove(colChkRef, ThisItem) will only remove this single record.
Remove and RemoveIf functions in Power Apps - Power Apps | Microsoft Docs
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 342 Super User 2026 Season 2
M Bilal Khan 271
Mohsin Ali 223