Using $filter on the names and worksheets endpoints for Excel

Derik Oliver 0 Reputation points
2025-01-27T03:39:59.6566667+00:00

I am trying to filter results returned from the names and worksheets endpoints, but my filter is not working, I get all results from both.

.../workbook/names?$filter=name eq 'Name1' - response includes all names

.../workbook/worksheets?$filter=name eq 'Sheet1' - response includes all sheets

Is this an expected limitation, or am I doing something wrong?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,956 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 9,780 Reputation points Microsoft Vendor
    2025-01-27T09:18:14.6566667+00:00

    Hello Derik Oliver,

    Thank you for reaching out to Microsoft Support!

    We also did the same test, the results are the same as yours, the $filter query parameter does not seem to work, you can give feedback here.

    We also recommend that you use the following path instead:

    To get a workbook:

    https://graph.microsoft.com/v1.0/me/drive/root:/documentSet:/children?$filter=name eq 'Name1.xlsx'

    Reference document:

    https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http

    To get a worksheets:

    https://graph.microsoft.com/v1.0/me/drive/root:/{item-path}:/workbook/worksheets/{id|name}

    Reference document:

    https://learn.microsoft.com/en-us/graph/api/worksheet-get?view=graph-rest-1.0&tabs=http

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.