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

Community site session details

Session Id : zzvEDVbx32x9MeXT1YFVY6
Power Apps - Building Power Apps
Answered

Checkboxes inside Gallery reset at after the button is clicked to filter the gallery

Like (0) ShareShare
ReportReport
Posted on 24 May 2023 20:31:55 by 11

Hello - I have a gallery with check-boxes, the gallery is filtered by a set of buttons (located outside of the gallery), button1, button2, button3 etc. When I select the checkbox under button1, press button2, and go back to number one, the checkbox dissapears and the value of all items in the gallery is turned to true. 

 

Checkbox onCheck property is: 

 

 

 

Collect(SelectedItems,ThisItem)

 

 

 

 

Checkbox onUncheck property is: 

 

 

 

Remove(SelectedItems,ThisItem)

 

 

 

 

What type of formula should the button have to retain the checked value of the gallery item? 

 

Thank you

  • Verified answer
    Annasuela Profile Picture
    11 on 25 May 2023 at 13:21:43
    Re: Checkboxes inside Gallery reset at after the button is clicked to filter the gallery

    Here's the solution to this problem:

    Checkbox Property:

    OnCheck

    collect(name,thisItem)

    OnUncheck

    remove(name,thisItem)

    Default Property: 

    If(IsEmpty(Filter(name, ID = ThisItem.ID)), false, true)

     

  • Annasuela Profile Picture
    11 on 24 May 2023 at 20:57:29
    Re: Checkboxes inside Gallery reset at after the button is clicked to filter the gallery

    Hi @mmollet - Thank you for the quick reply.

     

    These checkboxes are located inside a gallery which is connected to a collection. The user will check the completed items and based on their response, the items will display to another gallery which will connect to a SP list.  However, when I click any of the below boxes, the card turns to green checkboxes automatically disapear.

     

    Here's an image of my checkboxes. In this instance:

    1. I clicked on the Servers Button
    2. Made my selection 
    3. Clicked Voice
    4. Went back to Servers and this is my view
      1. the boxes are supposed to be green and checked  

    Annasuela_1-1684961716144.png

     

    Thank you again

     

  • mmollet Profile Picture
    3,187 on 24 May 2023 at 20:40:45
    Re: Checkboxes inside Gallery reset at after the button is clicked to filter the gallery

    I think what is happening is they are resetting bc it is fetching new data. I'm assuming that these checkboxes aren't tied to a column in the data source? If they aren't then you can add a column locally and make it default to false. Then use ThisItem.ThatColumn for the default values of the checkboxes.

     

    Here is the syntax of the AddColumns function

    AddColumns( Table, ColumnName1, Formula1 [, ColumnName2, Formula2, ... ] )

    • Table - Required. Table to operate on.
    • ColumnName(s) - Required. Name(s) of the column(s) to add. You must specify a string (for example, "Name" with double quotes included) for this argument.
    • Formula(s) - Required. Formula(s) to evaluate for each record. The result is added as the value of the corresponding new column. You can reference other columns of the table in this formula.

     

    Something like:

    ClearCollect(LocalSPListName, SPListName);

    AddColumns(LocalSPListName, "isSelected", false);

     

    Checkbox.Default -> ThisItem.isSelected

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete