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 / How to add item to col...
Power Apps
Answered

How to add item to collection which is a property of a parent collection?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to add more items to Location property but unable to via Patch or Collect

ClearCollect(
 incomingPeople,
 {
 Id: 10,
 Locations: [{Geography: "UK"}]
 }
);

Clear(selectedPeople);

ForAll(
 incomingPeople,
 Collect(
 selectedPeople,
 {
 Id: Id,
 Locations: ForAll(
 Locations,
 {Geography: Value.Geography}
 )
 }
 )
)

Attempt 1 - fail

Collect(LookUp(selectedPeople,Id=10).Locations, {Geography: "France"})

Attempt 2 - fail

Patch(LookUp(selectedPeople,Id=10).Locations, 
// not sure what to put as 2nd param,
{Geography: "France"})

Another attempt - fail

 

Patch(selectedPeople
, LookUp(selectedPeople,Id=10),
{Locations2:ForAll([{Geography:"France"}], {Geography:Value.Geography})})
Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    ClearCollect(
    incomingPeople,
    {
    Id: 10,
    Locations: [{Geography: "UK"}]
    }
    );

    Clear(selectedPeople);

    ForAll(
    incomingPeople,
    Collect(
    selectedPeople,
    {
    Id: Id,
    Locations: Locations
    }
    )
    );

     

     

    Patch(selectedPeople,LookUp(selectedPeople,Id=10),{Locations:Collect(LookUp(selectedPeople,Id=10).Locations,[{Geography:"France"}])})

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @Anonymous thanks for posting in the PowerApps community. Are you still having trouble with adding an item and can you review the above reply and advise if it was helpful? 

     

    Thank you,

     

    @Anonymous 

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Got it to work 

     

    Patch(items, LookUp(items, Id=ThisItem.Id), {Locations:ForAll(currentLocations, {Geography:Geography, Division : Division, Country:Country, City:City, ProvinceState : ProvinceState})})

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard