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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Checkboxes uncheck whe...
Power Apps
Answered

Checkboxes uncheck when search box is used

(0) ShareShare
ReportReport
Posted on by

Capture.PNGWhenever I search for something in the gallery it will uncheck the checboxes that are already checked. How do I prevent the gallery from resetting when I'm searching? 

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

    Hi @Anonymous ,

    I assume the check boxes are "unbound" (not connected to a data field).

    You need to add a field to your gallery (you can use AddColumns is this is a collection) and patch to this when the box is checked/unchecked. You then "bind" the box (ThisItem.NewFieldName) and it will remain checked.

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    what kind of field do i put in the gallery? Or use add columns? @WarrenBelz 

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @Anonymous ,

    You did not give a lot of details in your post, hence the general answer.
    What as the Items of the gallery? If a collection, then yes AddColumns will do the job.

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    Filter(
    CCB,
    If(
    IsBlank(Dropdown1.SelectedText.Value),
    true,
    'Functional Area' in Dropdown1.SelectedText.Value
    ),
    If(
    IsBlank(Filter.Text),
    true,
    StartsWith('Requirement Source',Filter.Text)
    ),
    If( // Add formula here
    IsBlank(Search_.Text),
    true,
    StartsWith(Name, Search_.Text)
    )
    )

    This is what I have in the gallery items. @WarrenBelz 

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @Anonymous ,

    One approach would be to do a Collection

    ClearCollect(
     colCCB,
     AddColumns(
     CCB,
     "Checked",
     false
     )
    )

    Your Items would then be

    Filter(
     colCCB,
     If(
     IsBlank(Dropdown1.SelectedText.Value),
     true,
     'Functional Area' in Dropdown1.SelectedText.Value
     ),
     If(
     IsBlank(Filter.Text),
     true,
     StartsWith('Requirement Source',Filter.Text)
     ),
     If( // Add formula here
     IsBlank(Search_.Text),
     true,
     StartsWith(Name, Search_.Text)
     )
    )

    The Default of your CheckBox would be

    ThisItem.Checked

    The OnCheck of your CheckBox would be

    Patch(
     colCCB,
     ThisItem,
     {Checked:true}
    )

    OnUncheck would be

    Patch(
     colCCB,
     ThisItem,
     {Checked:false}
    )
     

    Your check boxes would then retain their values.

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    WClearCollect(
    colCCB,
    AddColumns(
    CCB,
    "Checked",
    false
    )
    )

    Where does this part go? @WarrenBelz  

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @Anonymous ,

    Apart from the W at the front of your post, Screen OnVisible would probably be a good place. You need to initiate this collection before the gallery filter will work.

     

    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.

     

     

  • Community Power Platform Member Profile Picture
    on at

    Capture.PNG

    I put the onvisible and items in the gallery and now the Name is blank. @WarrenBelz 

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    @Anonymous ,

    I have not changed your Filter code except to use the Collection (which is the table plus an extra field) rather than the table. 
    You need to replace CCB with colCCB in your filter.

    Put a label on the screen with CountRows(colCCB) and see how many records are displayed.

     

  • Community Power Platform Member Profile Picture
    on at

    The checkboxes don't work. The number it lets me check increases each time. I clicked 2 and then it reset and the same happened with 3 and 4, it just changes back to false. @WarrenBelz 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard