I have a collection named "SelectedParticipants" which has only 1 column named "Email". Lets say it contains below values:
| Email |
| abc@xyz.com;def@xyz.com;asd@xyz.com; |
| abc@xyz.com; |
| abc@xyz.com;def@xyz.com; |
I have a SharePoint list Named "PersonList" which have a Person Type column named "Participants" and allow multiple selection
I want to save data to this Participant column base on Email addresses of the "SelectedParticipants" collection
I am using below code
ForAll(SelectedParticipants,Patch(PersonList, Defaults(PersonList),{Title:"test",Participants:If(!(IsEmpty(Email)),ForAll(Split(Email,";"),{DisplayName: Office365Users.UserProfile(Text(Trim(Result))).DisplayName,
Claims: "i:0#.f|membership|" & Lower(Office365Users.UserProfile(Text(Trim(Result))).Mail),
Department: "",
Email: Office365Users.UserProfile(Text(Trim(Result))).Mail,
JobTitle: "",
Picture: ""}))}
but I am getting below error "The requested operation is invalid. Server Response: PersonList failed: The specified user i:0#.f|membership| could not be found."
But if I use any hardcoded value like "abc@xyz.com" in Office365Users.UserProfile() function then data is saving in the Person Type column.
Can you please help what's the wrong I am doing.
Urgent help needed.
Thanks!