Using SOAP Services, we used to be able to add multiple items in a list that contains a people field just using the email address and without knowing the user id. In that case the value to provide was -1;#email@address
.
Example of a SOAP body to send:
<Field Name='ID'>New</Field><Field Name='Title'>Example</Field><Field Name='Name'>-1;#[email protected]</Field></Method>
It was very handy because we could add 50 items in 1 call.
I'm trying to do the same thing in SharePoint Online, without using SOAP services. It could be either REST or Graph.
So far I found that I need to first use ensureUser to get the user id for each email address, and then add the items using that user id… So instead of doing 1 call to add 50 items, I have to do 50 calls to get the user id, and then 50 more calls to add them (I may reduce the number of calls using the $batch
but I'm not sure it can work with ensureUser
).
Is there any other way to directly add a user using an email address to SPO?