web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Select All items in Ga...
Power Apps
Unanswered

Select All items in Gallery using a button or checkbox

(0) ShareShare
ReportReport
Posted on by 10

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?

antoniebrown1_0-1666790924936.png

 

Categories:
I have the same question (0)
  • Anonymous_Hippo Profile Picture
    1,247 Super User 2024 Season 1 on at

    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 !

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard