Hi,
I wanted to add a person (in my case a passenger) to a column Person Type by pressing a button in Powerapps. In Sharepoint, the column allows multiple people in a record.
I wanted to use the Patch() function and add the user with the User() function when the button is pressed.
Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous
ClearCollect(ExistingUsers,Table({'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & User().Email, Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:"", Picture:"" }),LookUp(SPListName,Title = "test").PersonField); Patch(SPListName,LookUp(SPListName,Title = "test"),{PersonField:ExistingUsers})
Hi @Anonymous
Patch(SPListName,Defaults(SPListName),{Title:"Test3456760",PersonField:Table({'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & User().Email, Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:"", Picture:"" })})
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
This didn't work for me because I dont have a UserList. All users are Office 365 Users.
Hi @Anonymous
hi @yashag2255 ,
Now I can add add a user to the record, but only one. if I have already an user (or more) in the record it deletes it/them.
Hi @Anonymous
ClearCollect(ExistingUsers,Table({'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & User().Email, Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:"", Picture:"" }),LookUp(SPListName,Title = "test").PersonField); Patch(SPListName,LookUp(SPListName,Title = "test"),{PersonField:ExistingUsers})
This worked. Thank you kind stranger.
The only thing: i replaced
Title = "test"
with
ThisItem
because i worked in a form.