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 / Master CheckBox - Sele...
Power Apps
Answered

Master CheckBox - Select all

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi Community,

 

I have a problem, hope you can help me. I have a collection that is "ColecciónReactivación", (When you click in the botton "Collecction" the gallery going to show you, all the data, as you can see in the pic1) ,a gallery named "Gallery3_2", a checkbox inside the gallery "CheckBox1_2" and a checkbox outside the gallery named "CheckBox3", also a botton "Actualizar" (Here, in this botton, I select first the items in the gallery and then click in this botton to update the data with the diferents filters that I have, as you can see in the pic2) and a botton "Borrar" (Here it's similar like the botton "Actualizar", the different it's that going to delete all the items that I'll select).

 

Pic1

Captura.PNG

Pic2

2.PNG

 

OnVisible - Screen

ClearCollect(ResultadoReactivado; {Result: "-Seleccionar-"});;
Collect(ResultadoReactivado; Distinct(Reactivaciones; Resultado));;
ClearCollect(Supervisor2; {Result: "-Seleccionar-"});;
Collect(Supervisor2; Distinct('Responsable - Asesores'; Responsable2))

Botton Collection - OnSelect.

ClearCollect(ColecciónREACT; AddColumns(Reactivaciones; "Seleccionado"; false))

Gallery3_2.Items

Search(
 Filter(
 ColecciónREACT;
 If(Dropdown3_7.Selected.Result = "-Seleccionar-";
 true;
 Resultado = Dropdown3_7.Selected.Result
 )
 );
 Searchbox_2.Text;
 "Responsable";
 "Responsable2";
 "Title"
) 
 

Gallery3_2.TemplateFill

If(ThisItem.Seleccionado; RGBA(255;211;0;100);Transparent)

CheckBox1_2.OnCheck

Patch(ColecciónREACT; ThisItem; {Seleccionado:true})

CheckBox1_2.OnUnCheck

Patch(ColecciónREACT; ThisItem; {Seleccionado:false})

CheckBox1_2.Default

ThisItem.Seleccionado

 

Also I have an accountant, that will show me how many items I'm selecting.

 

Pic3

3.PNG

HtmlText1_2.HtmlText

"<b>Seleccionado: </b>" & CountRows(Filter(ColecciónREACT; Seleccionado))

 

So here it's where I would like to solve my problem, I would like to select all the items of my gallery using my CheckBox3, also metion you that if a filter my gallery I will select just only the filter items. For example, DataBase in my gallery its just only 20, so if I filter the 20 items for 5, my CheckBox, will filter only the 5 and not the 20.

 

Hope you can help me.

 

Best regards.

 

 

 

 

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

    Hi @Anonymous ,

    It sounds like you want the behavior of CheckBox3 to affect the overall behavior of CheckBox1_2.

     

    You can set the Default property of CheckBox1_2 to:

    CheckBox3.Value

     

    When CheckBox3 is on, all the checkboxes in the gallery will match. If CheckBox3 is off, then all checkboxes in the gallery will follow.

     

    You can take actions against the items in the gallery whose checkbox are on using:

    Filter(Gallery3_2.AllItems; CheckBox1_2.Value)

     

    This means, "Filter the gallery to show records whose checkbox is true." 

     

    And in context:

    "<b>Seleccionado: </b>" & CountRows(Filter(Gallery3_2.AllItems; CheckBox1_2.Value))

     

    Let me know which parts need clarification and if this was helpful.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Mr-Dang-MSFT,
    Thank you for your soon reply, i have a couple of questions. 

     

    First, where i put this code?

    Filter(Gallery3_2.AllItems; CheckBox1_2.Value)

    in the same gallery? or in the checkbox3? please clarify me this subject

     

    Other think it's that when i want to update the data, i clicked in "select all", as you recommended me, but it doesn't update when i select all the data. 


    This is the code.

    ForAll(
     RenameColumns(
     Filter(
     ColecciónREACT;
     Seleccionado
     );
     "ID";
     "EID"
     );
     Patch(
     Reactivaciones;
     LookUp(
     Reactivaciones;
     ID = EID
     );
     {Responsable2: Dropdown6_2.Selected.Result};
     {Responsable: Label2_2.Text}
     )
     );;
    ClearCollect(
     ColecciónREACT;
     AddColumns(
     Reactivaciones;
     "Seleccionado";
     false
     )
    )

    i did some tests and i changed "Seleccionado" for "CheckBox3.Value", it updated, but all the data base, and not the filter data.

     

    Hope you can help me.

    Looking forward for your answer.

     

    Best regards.

     

    Diego F.

     

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

    Hi @Anonymous ,

    The solution I shared does not use collections at all. It is one way of achieving this.

     

    In your formula with Patch(), you can substitute the collection at the top of ForAll with the Filter I shared:

    ForAll(
     RenameColumns(
     Filter(Gallery3_2.AllItems; CheckBox1_2.Value);
     "ID";
     "EID"
     );
     Patch(
     Reactivaciones;
     LookUp(
     Reactivaciones;
     ID = EID
     );
     {Responsable2: Dropdown6_2.Selected.Result};
     {Responsable: Label2_2.Text}
     )
    );;

     

    This means, "For each of the rows in the gallery whose checkbox are checked, update the people responsable."

     

    Let me know if you need the collections somewhere else in the app, but they won't be needed if you use my solution.

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

    Hi @Anonymous ,

    Do you want to select only these filtered items in your Gallery when you do some filters operation firstly and check the "CheckBox3"?

     

    Regarding the needs that you mentioned, I think the UpdateIf function could achieve your needs. Please consider take a try with the following workaround:

    Set the OnCheck property of the CheckBox3 to following:

    UpdateIf(
     ColecciónREACT;
     ID in Gallery3_2.AllItems.ID;
     {
     Seleccionado: true
     }
    )

    When you check the CheckBox3, all these filtered Items in your Gallery would be checked.

     

    Please try above solution, check if the issue is solved.

     

    Regards,

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard