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 / Checkboxes in gallery ...
Power Apps
Answered

Checkboxes in gallery keeps refreshing when typing something in "search" textbox

(0) ShareShare
ReportReport
Posted on by 99

Hi everyone. I have checkboxes incorporated in my gallery and a textbox which serves as "employee name search box".

The checkboxes allows users to select multiple rows and save them by batch. This is working just fine until I decided to type in something in the searchbox. The gallery searches for the employee but the initial items selected by the user got refreshed. All items selected by the users got unchecked.

Is there a way to not refresh/reset the checkboxes when the user searches for an employee name?

I have a filter in my gallery "textboxsearch.text in empnamecolumn"

 

1 - I select multiple items

1.png

 

2- I search for a particular employee name

2.png

 

3 - initial checked selection are gone when I clear the searchbox

3.png

Categories:
I have the same question (0)
  • Verified answer
    Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    Hi @keihimekawa ,

    It sounds like:

    • You have a gallery for making selections.
    • The gallery's items change as the text in the search box changes.

     

    In a scenario involving selection of items, it is best to hold the selection in a collection and not rely on the checkbox alone. Then you can set the Default property of the checkbox to see if it is in the collection. You will need actions on the checkbox to remove and add records to the collection upon checking and unchecking the box.

     

    There's a good example of this pattern in the App in a Day workshop for Device Orders (see the PDF for Module 1):

    https://aka.ms/AppInADay

     

    1. Download the zip file.
    2. Open the zip file.
    3. Browse the contents of the zip to find "01-Power Apps Canvas App Lab Manual.pdf"
    4. The content on checkboxes starts around page 28.

    Let me know if you were able to implement the checkbox behaviors.

  • keihimekawa Profile Picture
    99 on at

    @Mr-Dang-MSFTyou are awesome! It worked! Thank you so much for sharing the "App in a day" workshop files!

  • keihimekawa Profile Picture
    99 on at

    Hi @Mr-Dang-MSFT - I added radio buttons on the gallery and a textbox wherein users can enter a comment if they selected "No".

    Radioboxes also resets just like the checkbox before. Should I do a patch function on the collection for Selected items? I tried doing this but apparently, new items are added on the collection. Aplogies if I have too many questions. I'm still trying to familiarize my way around PowerApps.

  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    Hi @keihimekawa ,

    When a gallery's Items change due to it being filtered/searched, the values that have been typed or selected in its controls change as well. Those values are not saved anywhere. We use collections so that even if the gallery changes, the values in the collection remain the same.

     

    You would be on the right track in using the Patch() function. If you are selecting a radio control and typing into a text box, you would set the OnChange property of the control to Patch the values to the respective columns in the collection.

     

    Some caveats here: 

    • Is the gallery's Items property pointing to the same collection that you want to update?
      • If a gallery is set to a collection, and you make changes to that collection, the gallery may reload to reflect the changes.
      • If the gallery is set to another data source and you make changes to the collection, you won't be affected.
    • The OnChange property of the text input box will execute its actions (Patch in your case) even with changing one character. You might want to turn the DelayOutput property to true so that the actions don't execute until you press enter or leave the text input box.
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you @Mr-Dang-MSFT ! It worked!

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
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard