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 / Powerapps CheckBox All...
Power Apps
Answered

Powerapps CheckBox All should uncheck if one of the checkbox is unchecked.

(0) ShareShare
ReportReport
Posted on by 5

Hi Team,

 

Please guide me on this issue. There are checkboxes in gallery and outside of it I have given a checkbox ALL which, if checked, will check all the checkboxes inside gallery and vice versa. If the outside check box is checked, I am adding all the items to a collection and then the further processing starts on click of a button. Now, the issue is, if the user checks the ALL and then decides to uncheck one of the item, the click on submit button is still taking all the items. I have used remove function under uncheck property of gallery item but the collection still takes all the items. Can I do something like, when the user decides to uncheck one checkbox, the checkbox ALL also gets unchecked and only the checked ones come into collection

Categories:
  • Ramanachiappan Profile Picture
    179 Moderator on at

    Try this one @Meghna_Jain ,

    Common CheckBox:

    1. OnCheck:

    ClearCollect([TempYourCollection],[YourCollection])
    ForAll([TempYourCollection] As Record,
    Patch([YourCollection],LookUp([YourCollection],ID = Record.ID),{[YourCheckBoxColumnName]:true})
    )

    1. OnUnCheck:

    ClearCollect([TempYourCollection],[YourCollection])
    ForAll([TempYourCollection] As Record,
    Patch([YourCollection],LookUp([YourCollection],ID = Record.ID),{[YourCheckBoxColumnName]:false})
    )

    Gallery CheckBox:

    1. OnCheck:

    Patch([YourCollection],LookUp([YourCollection],ID = ThisItem.ID),{[YourCheckBoxColumnName]:true})

    1. OnUnCheck:

    Patch([YourCollection],LookUp([YourCollection],ID = ThisItem.ID),{[YourCheckBoxColumnName]:false})

    Note:
    Please consider marking my post as the solution by clicking "Accept" if it assisted you in resolving your issue. This action will make it easier for others to find the solution and will close the item. If you found the content helpful in other respects, please consider giving it a thumbs up.

  • Verified answer
    v-yueyun-msft Profile Picture
    Microsoft Employee on at

    Hi , @Meghna_Jain 

     I test it in my side , you can refer to this:

    vyueyunmsft_0-1711958661933.png

    You need to use the ClearCollect() function to add a column like this:

    ClearCollect(Products2 , AddColumns(CustomGallerySample,"IsChoosen",false))
     
    CustomGallerySample is my test Table Name
    vyueyunmsft_1-1711958724507.png

     

    The check box in Gallery.

    OnCheck:

    Patch(Products2,ThisItem,{IsChoosen:true})
    OnUnCheck:
    Patch(Products2,ThisItem,{IsChoosen:false})
    Default:
    ThisItem.IsChoosen
     
    The All Checkbox outside of Gallery.

    OnCheck:

    UpdateIf(Products2 , true , {IsChoosen:true})
    OnUnCheck:
    UpdateIf(Products2 , true , {IsChoosen:false})
    Default:
    CountIf(Products2,IsChoosen) = CountRows(Products2)
     
    And we can use this code to get the slected items in Gallery:
    Filter(Products2,IsChoosen)
    vyueyunmsft_2-1711958864269.png

     

     

    If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance! 

     
     
  • Meghna_Jain Profile Picture
    5 on at

    Hi,

     

    Thankyou for the solution. I am able to resolve the issue now.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard