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})})
Solved! Go to Solution.
Got it to work
Patch(items, LookUp(items, Id=ThisItem.Id), {Locations:ForAll(currentLocations, {Geography:Geography, Division : Division, Country:Country, City:City, ProvinceState : ProvinceState})})
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"}])})
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
Got it to work
Patch(items, LookUp(items, Id=ThisItem.Id), {Locations:ForAll(currentLocations, {Geography:Geography, Division : Division, Country:Country, City:City, ProvinceState : ProvinceState})})
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
187 | |
70 | |
49 | |
36 | |
25 |
User | Count |
---|---|
239 | |
111 | |
89 | |
88 | |
66 |