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 multiple items ...
Power Apps
Unanswered

Select multiple items and All item of a gallery with CheckBox powerapps

(0) ShareShare
ReportReport
Posted on by

Hello, I am new to Powerapps and am developing a dashboard for end users.
For this, I utilized a PowerApps gallery and displayed filtered content relevant to their scope (e.g. To only display Approval Requests that belong to a user, we use a filter:
Gallery -> Item = Filter(Datasource, UserEmail = User().Email and Status="Pending"

Following that, I added a checkbox to the gallery and displayed gallery-related data in front of them. I can update data for a single ID using the approval icon l - > onselect = UpdateIf(Datasource,ID = Gallery1.Selected.ID,{Status:"Approved"})
I'm having difficulty achieving the desired outcome using the multi-select and select-all approaches.

Gallery checkbox -  on Checkbox onCheck= Collect(selectedColl,ThisItem)
UnCheck = RemoveIf(selectedColl,Value=ThisItem.Value)
 
How can I obtain the required outcome by choosing Select all checkbox and on clicking the Approval button, datasource list update or patch the value as Approve?


Prathamesh2415_0-1705562214072.png

 

                                  

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,471 Most Valuable Professional on at

    Hi @Prathamesh2415 ,
    This should update any items checked in the gallery - you do not need any collections here

    Patch(
     DataSource,
     ForAll(
     Filter(
     Gallery1 As _Data,
     CheckBoxName.Value
     ),
     {
     ID: _Data.ID,
     Status: "Approved"
     }
     )
    )

    If you want to simply update all

    Patch(
     DataSource,
     ForAll(
     Gallery1 As _Data,
     {
     ID: _Data.ID,
     Status: "Approved"
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • mmbr1606 Profile Picture
    14,615 Super User 2026 Season 1 on at

    hey @Prathamesh2415 

     

    try the following approach please:

    • Place a checkbox outside the gallery and name it chkSelectAll.
    • Set its OnCheck property to:

     

    ClearCollect(selectedColl, Filter(Datasource, UserEmail = User().Email and Status="Pending"))

     

    Set its OnUncheck property to:

     

    Clear(selectedColl)

     

     

    In the gallery, your existing checkbox should have the OnCheck and OnUncheck properties set as you described.

     

    OnCheck: If(!chkSelectAll.Value, Collect(selectedColl, ThisItem))
    OnUncheck: If(!chkSelectAll.Value, RemoveIf(selectedColl, ID = ThisItem.ID))

     

    For the button that approves the selected items, set its OnSelect property to something like:

     

    ForAll(selectedColl As _item, Patch(Datasource, LookUp(Datasource, ID = _item.ID), {Status: "Approved"}))

     

    Ensure that the gallery's Items property is set to filter based on the current status, like:

     

    Filter(Datasource, UserEmail = User().Email and Status="Pending")

     

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • Prathamesh2415 Profile Picture
    on at

    Hello, It works, however I am unable to select all of the checks when I check the chkSelectAll checkbox.

  • mmbr1606 Profile Picture
    14,615 Super User 2026 Season 1 on at

    hey @Prathamesh2415 

     

    what happens when u check the "mastercheckbox"? nothing?

  • Prathamesh2415 Profile Picture
    on at

    Hello so i just Tested again its working correctly when i click on approve button it approve all the request not even checking if checkbox is checked or not .

    for mactercheckbox if we check nothing is happening on check of mastercheckbox all the checkbox need to be checked.

  • Prathamesh2415 Profile Picture
    on at

    i fix this - 
    CheckSelect All - 
    Default - varAllChekbox
    OnCheck -
     UpdateContext({varAllChekbox:true});
    ClearCollect(checkselecoll, Filter(DataSource,Status="Mail Sent"));
    OnUncheck- 
    UpdateContext({varAllChekbox:false});
    Clear(checkselecoll)

     

    Checkbox - 
    Default - varAllChekbox
    OnCheck - If(!checkboxAll.Value, Collect(checkselecoll, ThisItem))
    OnUncheck
    If(!checkboxAll.Value, RemoveIf(checkselecoll, ID = ThisItem.ID));
    Reset(checkboxAll);

    Still struggling with issue of  -

    It works well when I check or uncheck items individually or when I Select All to check all or uncheck all.

    The problem is when I want to check all then uncheck some items , selectAll button will uncheck and checkselecoll collection item must only contain selected Collection value

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard