Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

nested gallery wont update correctly

I have a gallery nested inside another gallery.


The child gallery has check boxes that when a button is selected, all the checked boxes will go to a collection and will be grouped together with matching ID's.


I also have another gallery that displays the created ID and when that ID is selected, the check boxes in the child gallery will be rechecked if they appear in the collection.


However whenever I select the ID to update the child gallery, they don't update the right checkboxes.


They are correct in the collection I am referencing but seem to get mixed up when translated intoa child gallery.


Any ideas?

Community Support Team
Community Support Team

Re: nested gallery wont update correctly

Hi @patrick1992,


Please share the detailed configuration of this app. Especially the related formulas. Some threads about nested galleries in powerapps that might help:




Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level: Powered On

Re: nested gallery wont update correctly

Just to add more detail. Below is a screen shot of the app




The user adds a name to the section and then checks the tasks they want and then click 'New Department' to add it to a collection.

A letter appears at the side to represent the the created section and when that letter is selected, it's name appears again in the section text box and and the tasks I previously selected are checked again in the gallery.


The task gallery is a child gallery of the task group gallery.

On open, all the tasks groups are closed but when selecting the group, the tasks and it's checkboxes appear.


The issue I have is when I re-select a section by selecting the letter the right checkboxes are not checked.


Below is the code that is used when a letter is selected.



//The child gallery that holds the data about tasks gets it's data from coll_tasks_lookuo
//Clear the task lookup so you can repopulate it with the selected section's tasks UpdateIf(coll_tasks_lookup,true,{task_selected:false});
//coll_job_details is where all the checked tasks are stored //Collect all the tasks that have the selected section's letter from coll_job_details and add to coll_selectedLetterSection ClearCollect(coll_selectedLetterSection,Filter(coll_job_details,section_code=ThisItem.Result)); //Set the tasks in coll_tasks_lookup to true where the task_id in coll_tasks_lookup are equal to selected_task_id in coll_selectedLetterSection ForAll(RenameColumns(coll_selectedLetterSection,"task_id", "selected_task_id"),Patch(coll_tasks_lookup, LookUp(coll_tasks_lookup, Text(task_id) in Text(selected_task_id)),{task_selected:true})); //var_selectedSection_letter and var_section are used to check if the selected section already exists if you update this sections tasks UpdateContext({var_selectedSection_letter:Text(First(coll_selectedLetterSection).section_code)}); UpdateContext({var_section:First(coll_selectedLetterSection).section})




Below is the code that is used when the 'New Department' is selected.



//The below 'If' test to see if the name is blank or no task is selected If(And(IsBlank(txt_section_name.Text),var_CountSelectedValues=0),UpdateContext({depErrorViz:true}),UpdateContext({depErrorViz:false}); //var_selectedSection_letter is the variable that was made when a letter was selected in Gallery_section_lookup //Below is another 'If' checks to see if the section already exists and if it does will add nw details to it"); And(Not(IsBlank(var_selectedSection_letter)), LookUp(coll_job_details,section_code=var_selectedSection_letter,section_code)=var_selectedSection_letter), //The RemoveIf() below will remove the selected section from the coll_job_details and re-Collect them so that there are no duplications RemoveIf(coll_job_details,section_code=var_selectedSection_letter); Collect(coll_job_details,Filter(AddColumns(coll_tasks_lookup, "description","test","section",txt_section_name.Text,"section_code",var_selectedSection_letter),task_selected=true)); //Reset the the task look up and section UpdateIf(coll_tasks_lookup,true,{task_selected:false}); UpdateContext({var_section:""}); UpdateContext({var_selectedSection_letter:""}); Reset(txt_section_name), //Below is an 'Else' for when the section doesn't exist //Get a new letter to reference the section and then remove selected letter from coll_alpha //Add the new section to the coll"); UpdateContext({var_letter:First(coll_alpha).letter}); UpdateContext({var_newletter:First(coll_alpha).letter}); Remove(coll_alpha,First(coll_alpha)); Collect(coll_job_details,Filter(AddColumns(coll_tasks_lookup, "description","test","section",txt_section_name.Text,"section_code",var_letter),task_selected=true)); UpdateIf(coll_tasks_lookup,true,{task_selected:false}); UpdateContext({var_selectedSection_letter:""}); UpdateContext({var_section:""}); Reset(txt_section_name) )


Helpful resources


Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Power Platform World Tour

Coming to a city near you


PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Join PowerApps User Group!!

Connect, share, and learn with your peers year-round


Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 59 members 4,917 guests
Please welcome our newest community members: