I have a Sharepoint Online list with a column of type "Person or Group". I want to make a new entry for such a column using the Microsoft Graph API (eventually from a Teams bot).
My problem is that such a column holds a lookup value into something and I don't know how to get this number. I can successfully get a user object from Graph (/me or /users) but the object returned has an id which is something completely different. How do I link this to what Sharepoint Online requires?
Example: Sharepoint column SG_Responsible
of type "Person or Group" as returned by Graph (note it is reported as SG_ResponsibleLookupId
):
"fields": {
"@odata.etag": "\"e2977d91-fd6d-4141-8bc6-897f5bbe9840,1\"",
"Title": "Test 2",
"SG_ResponsibleLookupId": "12",
"SG_Description": "This is a Test",
...
The corresponding user from /users
:
{
"businessPhones": [],
"displayName": "John Doe",
"givenName": null,
"jobTitle": null,
"mail": null,
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": null,
"userPrincipalName": "john@example.com",
"id": "76a3b5b7-768b-4dde-ba13-6d471aa2c7fd"
},
So how to figure out that this user is user #12 for Sharepoint?