I have a canvas app Gallery and want to be able to select all the items 'Select(Parent)' by either pressing a button or checking a Checkbox. How could I achieve this?
Hello @antoniebrown1 ,
Are you selecting items to move to a collection ?
Here are two ways
1. This is a solution by cbernier12 : https://powerusers.microsoft.com/t5/Building-Power-Apps/Gallery-select-all-and-add-to-collection/td-p/779565
Add a checkbox outside of the gallery and add the values:
OnCheck:
UpdateContext({CheckCheckbox:true});ForAll(Collect(ItemSelectionCollection,'MyGallery'.AllItems),ThisRecord)
OnUncheck:
UpdateContext({CheckCheckbox:false});Clear(ItemSelectionCollection)
For the checkbox in the Gallery add the term "CheckCheckbox" in the "Default" field setting. This is referenced in the select all checkbox info above.
When I use my search box that lives outside of the gallery to narrow down results and check the "select all" checkbox it only selects the items in view and adds them to the collection. When I uncheck, it unchecks the items and clears the collection.
2. If you are filtering to select these multiple values then you can easily replicate that by copying the items property of your gallery into a button , so when you run the OnSelect, a collection would be made of the filtered components
Cheers !
WarrenBelz
146,765
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional