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 ?
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.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2