Showing results for 
Search instead for 
Did you mean: 
Helper IV
Helper IV

Checkbox to selectall in a FILTER gallery

Hi all,

I have a gallery with checkbox in all rows. I have a checkbox to select all items outside gallery too. I try to insert in the default property in the checkbox: checkboxselectedall.value, so if I click on the checkbox it selected all rows.

I have a filter outside gallery (for example to select only row in the gallery that are man), I would like to filter man and then I want to click on checkboxselectedall and select only row with man.

Do you have an idea?


Thank you

Helper IV
Helper IV

Yes you have understand my request! I would like to give to the user two choices, they can select some rows inside the gallery (with the checkboxes that are in all single rows) or they can select all rows by the checkbox outside the gallery, then they can select a choices with the dropdown (otuside the gallery) and then they can patch all changes by the save button (outside the gallery). So with the SelectAll checkbox it work correctly but it don't work if I select a checkbox inside the gallery. I think that I need to insert some formula on the OnCheck and OnUncheck property inside the checkboxes in the gallery.
Can you help me here for the last task?

I insert a picture to show my request, tell  me if you need more information about this. Thank you so much



Helper IV
Helper IV

I insert on the checkbox inside gallery OnCheck property:

Collect(collection; {itemId: ThisItem.ID}) 

 and the follow code OnUncheck property:

Remove(collection; LookUp(colToPatch; itemId = ThisItem.ID))  

I think that I need to integrate my save button code with something follow code

            ID = itemId
            ID: itemId;
            Selezione: Dropdown4_10.Selected


Super User
Super User

I gave you a code sample in my latest post. Did it not work properly?

Helper IV
Helper IV

No @WiZey don't work, maybe I make something wrong.

I write you all code in my objects.


1. I have a button to create a collection, OnSelect I have

ClearCollect(collection; AddColumns(TEST_RUOLI; "Selected"; false))

 2. I have a selectAll checkbox outside gallery with OnSelect property:


3. I have a gallery with items property:


4. Inside gallery I have a chechoxes in every rows with OnCheck property:

Collect(collection; {selectedItems: ThisItem.ID}) 

In OnUncheck property:

Remove(collection; LookUp(collection; selectedItems = ThisItem.ID))  

5.I have a savebutton, OnSelect property:

    ForAll(selectedItems;{ Selezione: Dropdown4_10.Selected})

ClearCollect(collection; AddColumns(TEST_RUOLI; "Selected"; false));;
Notify("Salvataggio eseguito con successo";NotificationType.Success;2000)


So if I click on SelectAll checkbox, I choose an option in dropdown and then I click on the save button I can see changes in my sharepoint list, it don't work if i select different checkboxes inside the gallery and then I choose a value from dropdown and save.

Super User
Super User

The "OnCheck" and "OnUncheck" of your gallery is wrong. You shouldn't add/remove items, you have to update them to turn them selected/unselected.


OnSelect:Patch(collection; ThisItem; {Selected:Self.Value})


The code in your save button work with items that have been marked as selected, not if the item is added or removed.

Helper IV
Helper IV

It's work @WiZey  thank you!

So I have just two bug, it's so strange. Look the follow picture:


I click on the checkboxes, I see just a millisecond the flag and then I don't see it but the value is true after click (you can see on the right) so if I change the value from dropbox and I click on save button I can see the changes.

Another strange error is that after I click on the save button, all checkbox value are true as you can see in the follow picture


Do you know where is the problem?

Super User
Super User

For the first error, can I ask you to check the "Default" property of the checkboxes? The default value should be "ThisItem.Selected".


As for the second error, I'm not quite sure what exactly produce this result. Your "ClearCollect()" does create the column with a "false" value though, so it's quite unclear why it would behave this way. I'll need to do some experiments on my side to try and replicate the situation.

Helper IV
Helper IV

Hi @WiZey , I insert your code in the Default property of the checkboxes, I resolved both problem!

You are incredible! Thank you so much for your patience (I'm sorry if I have not always understood everything quickly but I'm new with this platform).

You are a good teacher and I hope that you will answer me again in the future.


Thank you so much


Helpful resources

Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,549)