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})})
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.
User | Count |
---|---|
203 | |
106 | |
56 | |
51 | |
41 |
User | Count |
---|---|
273 | |
156 | |
85 | |
81 | |
56 |