1
votes

I perform the following query in Microsoft Graph:

var results = await SPLists["<my-list-name>"]
                .Items
                .Request()
                .Expand("fields")
                .GetAsync(); 

It gets the list items of a list I have in SharePoint. One of the columns in that list is of type "Person or Group". In the response from Microsoft Graph, it returns that column data like this (for example):

{
    "LookupId": 335,
    "LookupValue": "John Doe"
}

How do I take advantage of this data? How do I get the full profile of person with ID 355 using the Microsoft Graph? I need the email address of the person returned. How do I get that using the Microsoft Graph SDK?

1
Have you tried the suggestion in the comment ? Did it work ?Jerry

1 Answers

3
votes

The Look Id 335 is the Id in the SharePoint Hidden List named "User Information List", you can get the list guid using the request:

https://graph.microsoft.com/v1.0/sites/site-id/lists?$filter=DisplayName eq 'User Information List'

Then use the list guid in the endpoint below to get the detail email address:

https://graph.microsoft.com/v1.0/sites/site-id/lists/UserInformationListId/items/335

enter image description here

Here is a similiar thread for your reference:

How to get user from User field LookupId