sharepointmicrosoft-graph-apisharepoint-api

How to filter Sharepoint Terms in Microsoft Graph API?


How can I filter Sharepoint Terms by name using Microsoft Graph API?

Here is a sample of results returned by the request without filter:

{
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#termStore/groups('xxxxxxxxx')/sets('xxxxxx')/terms",
    "value": [
        {
            "id": "fb0d9476-4cec-46d5-acd5-12245de95308",
            "createdDateTime": "2017-06-28T15:07:44.18Z",
            "lastModifiedDateTime": "2021-03-12T11:31:36.137Z",
            "labels": [
                {
                    "name": "Hello",
                    "isDefault": true,
                    "languageTag": "en-US"
                }
            ],
            "descriptions": []
        },

I tried to filter like this:

But any request worked (Invalid filter clause, Parsing OData Select and Expand failed: Property 'labels' on type 'microsoft.graph.termStore.term' is not a navigation property or complex property. Only navigation properties can be expanded.).

Thanks for your help!


Solution

  • You should use the filter like the below:

    ?$filter=labels/any(s:s/name eq 'Hello')