Not every property if filterable in the Graph. Generally speaking, you should consult the documentation each time you plan to use a filter, for example the article on Group properties shows assignedLabels as not filterable: https://learn.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0#properties
Graph API assigned label filtering
Ricardo Matos
0
Reputation points
Hello everyone! I'm making a graph API call the following way:https://graph.microsoft.com/beta/users/{user_ID}/ownedObjects/microsoft.graph.group$select=id,displayname,createdDateTime,assignedLabels&$count=true&$filter=assignedLabels/any(label : label/displayName eq 'TEST') In essence I'm trying to fetch all the groups that contain the label "Test" What I would expect to get back as a reply is this:
"@odata.context": "https://graph.microsoft.com/beta/$metadata#groups(id,displayName,createdDateTime,assignedLabels)",
"value": [
{
"id": "[GUID]",
"displayName": "TEST",
"createdDateTime": "2023-02-04T15:24:05Z",
"assignedLabels": [
{
"labelId": "[GUID]",
"displayName": "TEST"
}
]
}
However I'm getting the following reply back:
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Unsupported query on property 'AssignedLabel'.",
"innerError": {
"date": "2024-01-31T15:31:13",
"request-id": "8f3de165-3c0b-4ff2-84ac-95f0ab042227",
"client-request-id": "8f3de165-3c0b-4ff2-84ac-95f0ab042227"
}
}
}
Any idea why this filter operation is invalid? Thank you!