Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Repeating Parent/Child Galleries a real humdinger!!

Like (1) ShareShare
ReportReport
Posted on 23 Sep 2024 15:19:11 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 24 Sep 2024 at 16:05:41
    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 23 Sep 2024 at 19:54:57
    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 29,371 on 23 Sep 2024 at 17:07:28
    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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,238

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,290

Leaderboard