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 / parent child data usin...
Power Apps
Answered

parent child data using collections

(0) ShareShare
ReportReport
Posted on by 443

Hallo,

I have created a demo app and i am not using any forms. Just fields and i am using Collect to save the data to collections.

there is a uniqueID which is produced.

From a combo box field i want to add participants (this should be the child list).

the items of the combo box is Office365Users.SearchUser({searchTerm:personDD.SearchText,top:100})

On the OnChange property i make a Collection. Collect(colTravelParticipants, personDD.Selected);

Then i am using a button to add a column for the ParentID in order to connect the participants with the Parent record.

OnSelect: Collect(colTravelParticipantsWithID,ShowColumns(AddColumns(colTravelParticipants,"ParentID",var_uniqueID),"DisplayName","Mail","Department","ParentID")).

The problem is that every time i am creating a new record and adding participants, the Parent ID in the colTravelParticipantsWithID, gets updated (including Previous records with the previous uniqueID) so i am getting All records with the same unique ID.

 

Any ideas ?

 

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @marial16 ,

     

    The issue is you are AddColumns and ShowColumns each time you click the button to add parentID. The two functions will loop all the source table. They should use only once to change the structure of a table.

     

    Please try below steps:

    1. OnChange of Combo box:

    ClearCollect(
     colTravelParticipants,
     personDD.Selected
    );
    Collect(
     colTravelParticipantsWithID,
     AddColumns(
     ShowColumns(
     colTravelParticipants,
     "DisplayName",
     "Mail",
     "Department"
     ),
     "ParentID",
     ""
     )
    )

     

    2. OnSelect of add ID button:

    Patch(
     colTravelParticipantsWithID,
     LookUp(
     colTravelParticipantsWithID,
     DisplayName = personDD.Selected.DisplayName
     ),
     {ParentID: var_uniqueID}
    )

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard