Skip to main content

Notifications

Power Platform Community / Forums / Building Power Apps / Repeating Parent/Child...
Building Power Apps
Answered

Repeating Parent/Child Galleries a real humdinger!!

Posted on by 15
@RandyHayes @WarrenBelz
 
Ok I have a humdinger or a problem.  I have a parent/nest child gallery with repeating table which work just fine, however I am using a button to add the whole thing all over again.
but when I click on the Add Org button which has this code on it
Collect(
    colOrganizations,
    Defaults(Organizations)
)
I am getting this
It is not clearing the previous selections from the first Org 
 
this is the code for the Add Task button
Set(currentOrganization, galOrganizations.Selected.Name);


Collect(
    colSubOrgs,
    {
        ID: GUID(),
        Sub_Org_Name: "",
        TaskStatusDescription: "",
        Task_Org_Status: "",
        Parent_Org_Name: currentOrganization,
        TaskManagerID:cxtManager,
        isNew: true
    }
);

and here is the code for the items of the galChildren
SortByColumns(
    Filter(
        colSubOrgs,
        Parent_Org_Name = currentOrganization
    ),
    "isNew", 
    SortOrder.Ascending,  
    "ID", 
    SortOrder.Descending  // Newest saved tasks at the top
)
I am not sure how to get this to repeat the setup but not copy the previous selections
  • Verified answer
    Dorinda Profile Picture
    Dorinda 15 on at
    Repeating Parent/Child Galleries a real humdinger!!
    I figured it out just needed to save the Items Property to this 

     
    SortByColumns(
        Filter(
            colSubOrgs,
            Parent_Org_Name = ThisItem.Name
        ),
        "isNew",
        SortOrder.Ascending,  
        "ID",
        SortOrder.Descending  
    )
    Changing the ThisItem.Name worked just like it was supposed to do I was over thinking it.
  • Dorinda Profile Picture
    Dorinda 15 on at
    Repeating Parent/Child Galleries a real humdinger!!
    If I do a clear collect it will not keep what is in the first set of Parent Org and sub org, It is saving back to the same collection how do i get around that ?
  • FLMike Profile Picture
    FLMike 26,301 on at
    Repeating Parent/Child Galleries a real humdinger!!
    HI
     
    It's not clearing because you are doing a Collect, not a ClearCollect.
     

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

September 2024 Newsletter…

September 2024 Community Newsletter…

Community Update Sept 16…

Power Platform Community Update…

Welcome to the new Power Platform Community!…

We are excited to announce our new Copilot Cookbook Gallery in the Community…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 141,122

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,414

Leaderboard