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 / Select All check boxes...
Power Apps
Answered

Select All check boxes in a Nested gallery

(0) ShareShare
ReportReport
Posted on by 125

Hello,

 

I have a nested gallery that allows the users to make some edits to a record then when they select the check box for that record, is sends that item to a collection and does some other maths stuff. If they uncheck it it removes it from that collection.

 

Which is fine and it works, however I am aware my users wont always want to check every single item in that gallery and for some of them a select all button would be useful. The issue I have is making that select all work within the nested gallery. 

 

My nested gallery looks like the below screenshot, if you ignore the messy UI.

 

Jezter12_0-1667925910108.png

Any ideas on how i can achieve either a select all in each column or a select all outside of the gallery?

 

Thanks

Categories:
  • v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Jezter12 ,

     

    I've made a test for your reference:
    1\I assume there is a parent gallery(ParentGallery) and it's items property is 

    Table({ID:1,subTable:[1,2,3,4,5]},{ID:2,subTable:[1,2,3,4,5]},{ID:3,subTable:[1,2,3,4,5]})

    vbofengmsft_0-1667974286828.png

     

    2\Add a Check box(CheckboxSelectALL) into ParentGallery and set it's 

     

    OnCheck

    Collect(IfSellectAll,{ID:ThisItem.ID})

     

    OnUncheck

    RemoveIf(IfSellectAll,ID=ThisItem.ID)

     

    3\Add a sub gallery(SubGallery) into ParentGallery and set it's items property to

    AddColumns(ThisItem.subTable,"ID",ThisItem.ID)

     

    4\Add a checkbox(Checkbox2) into the sub Gallery and set it's Default property to

    ThisItem.ID in IfSellectAll

     

    vbofengmsft_1-1667974465994.png

    vbofengmsft_2-1667974491090.png

    vbofengmsft_3-1667974512847.png

     

    Best Regards,

    Bof

     

     

  • Jezter12 Profile Picture
    125 on at

    So I have tried the above and my Parent Gallery is a bit more complex as it has a sortbycolumns, groupby and a filter on it. So the formula in the parent looks thus

    GroupBy(SortByColumns(Filter(AddColumns(ColVROM,"PType",Name),PType = Dropdown2.SelectedText.Value),"field_1",["Initiate", "Define & Design", "Build & Deliver", "Closure"]),"field_1","DATA")

     

    The Child gallery is then run from ThisItem.data

     

    The formula that runs on selection of the check box then looks like this. Note that it also runs a calculation to work out the amount of working days between 2 dates, that are stored at the Parent gallery level it then runs another calculation to work out how much it would cost a day.

     

    Collect(colVROMsub,{
     Title: TextInput7.Text,
     ResourceType: ThisItem.Skill,
     FTE: Value(TextInput6.Text),
     StartDate: DatePicker3_1.SelectedDate,
     EndDate: DatePicker3.SelectedDate,
     Stage: Label19.Text ,
     ProjectSize:Dropdown2.SelectedText.Value, 
     TotalDays: Value(With(
     {
     // generate a one-column table of all dates between start date & end date
     varDateRange: ForAll(
     Sequence(DatePicker3.SelectedDate - DatePicker3_1.SelectedDate + 1),
     DatePicker3_1.SelectedDate + Value - 1
     )
     },
     If(
     And(
     IsBlank(DatePicker3_1.SelectedDate),
     IsBlank(DatePicker3.SelectedDate)
     ),
     // show nothing if any date pickers are blank
     0,
     // include only dates Monday to Friday
     CountIf(
     varDateRange,
     Weekday(Value) in [2, 3, 4, 5, 6]
     )
     )
    ))* Value(TextInput6.Text),
     Cost: Value(With(
     {
     // generate a one-column table of all dates between start date & end date
     varDateRange: ForAll(
     Sequence(DatePicker3.SelectedDate - DatePicker3_1.SelectedDate + 1),
     DatePicker3_1.SelectedDate + Value - 1
     )
     },
     If(
     And(
     IsBlank(DatePicker3_1.SelectedDate),
     IsBlank(DatePicker3.SelectedDate)
     ),
     // show nothing if any date pickers are blank
     0,
     // include only dates Monday to Friday
     CountIf(
     varDateRange,
     Weekday(Value) in [2, 3, 4, 5, 6]
     )
     )
    ))* Value(TextInput6.Text)*400
     
    
     }
    )

     

    maybe i have gone overcomplex?

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

    Hi @Jezter12 ,

     

    Please try:

     

    2\Add a Check box(CheckboxSelectALL) into ParentGallery and set it's 

     

    OnCheck

    Collect(IfSellectAll,{field_1:ThisItem.field_1})

     

    OnUncheck

    RemoveIf(IfSellectAll,field_1=ThisItem.field_1)

     

    3\Add a sub gallery(SubGallery) into ParentGallery and set it's items property to

    AddColumns(ThisItem.DATA,"field_1",ThisItem.field_1)

     

    4\Add a checkbox(Checkbox2) into the sub Gallery and set it's Default property to

    ThisItem.field_1 in IfSellectAll

     

    Best Regards,

    Bof

  • Jezter12 Profile Picture
    125 on at

    Thanks Bof,

     

    Whilst the above does work to check all the boxes, the issue then arises that it doesnt then seem to run the Oncheck formula in the child gallery check boxes. This may be down to the the formula working on the default value, so its not physically checking or unchecking the boxes.

     

    I guess that as I have a submit button out side of the gallery I can add something to that to check if all items in the sub gallery have a box checked then that data is submitted to the collection. I just need to figure out how that would work, as my previous attempt at it would only submit the data from the first column in the gallery.

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 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard