.netmicrosoft-graph-apisharepoint-online

Filter Multiple Lookup field with Microsoft Graph


I am trying to filter a list of item by a Multiple Lookup field.

I have already successfully filtered the list by a lookup field by using this code:

"startswith(Fields/ThemeLookupId%2C+'" + theme + "')"

But using this doesn't work on Multiple Lookup field.

Is there a way to filter Multiple Lookup field?

Otherwise I will end up selecting all the list and filtering using linq.

Any help will be appreciated!


Solution

  • I don't believe it is supported to filter a multi-valued lookup column for a single value. I have attempted the following and get a 400 Bad Request "Filter not supported" response.

    https://graph.microsoft.com/(version)/sites/(site-id)/lists/(list-id)/items?$expand=fields&$filter=(fields/LookupSeason/any(x:x/LookupValue eq 'Summer'))

    In my example "LookupSeason" is the lookup column that allows multiple values and each item in list has at least 2 selected.