Skip to main content

Notifications

Community site session details

Community site session details

Session Id : ozzOcS2CJgQcUFTNDoLS6U
Power Apps - Building Power Apps
Unanswered

Select All items in Gallery using a button or checkbox

Like (0) ShareShare
ReportReport
Posted on 26 Oct 2022 13:29:12 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

 

  • Anonymous_Hippo Profile Picture
    1,247 Super User 2024 Season 1 on 26 Oct 2022 at 13:44:58
    Re: Select All items in Gallery using a button or checkbox

    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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,765 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard
Loading started