0
votes

I have a lookup column that allows multiple values per item. I use the Microsoft Graph .NET SDK to retrieve all the column values for a list item:

ListItem item = await graphClient.Sites[siteId].Drive.Items[itemId].ListItem.Fields.Request().GetAsync();

I also tried to retrieve the lookup column specifically:

var queryOptions = new List<QueryOption>()
{
   new QueryOption("expand", "fields(select=MultipleLookupColumn)"))
};
ListItem item = await graphClient.Sites[siteId].Drive.Items[itemId].ListItem.Request(queryOptions).GetAsync();

It correctly shows the column values, including custom columns, except for the multiple lookup column. The lookup column shows up in item.Fields.AdditionalData, but it is always an empty array, even when there are values assigned to it on Sharepoint Online. But if I change the lookup column to disallow multiple values, it shows the value correctly.

How can I get the values of a multiple lookup column using the Graph API? Or are multiple lookup values not supported?

1

1 Answers

0
votes

I found that it is a permissions issue. I had it set up with the Files.ReadWrite.All permission, which is sufficient for reading the document library and files in Sharepoint Online, including lookup columns with single values. But unfortunately not lookup columns with multiple values. Once I added the Sites.Read.All permission, the multiple lookup values array was no longer empty.