Is there any Graph API to get the rows from excel worksheet with some filter on column values?

ffbld01@uk.ibm.com 96 Reputation points
2022-04-20T12:42:13.213+00:00

We are using Graph API for one of our excel-based applications. Currently, we have planned to use range API to retrieve the values for specific excel rows. Our queries are like following https://graph.microsoft.com/v1.0/me/drive/items/{{ITEM_ID}}/workbook/worksheets/{{worksheet_id}}/range(address='A1:Z100') which works. But now we want to add some filters in the query like we want to query any row that has a value for A=1234 but when we tried adding such filter on the URL, it says bad request. Look at the following query https://graph.microsoft.com/v1.0/me/drive/items/{{ITEM_ID}}/workbook/worksheets/{{worksheet_id}}/range(address='A1:Z1')?$filter='A eq 1234'

Could you suggest to us any API that can achieve the above use case?

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

2 answers

Sort by: Most helpful
  1. Shivam Dhiman 5,946 Reputation points
    2022-04-21T16:40:16.307+00:00

    Hi @ffbld01@uk.ibm.com

    Based on my test filter query parameter only works with the collection of the result.
    The range that your are using in your query is not a collection. As per documentation only these properties are available for range. There is no property available where you can directly use filter clause to get particular value of cell.

    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.

    0 comments No comments

  2. ffbld01@uk.ibm.com 96 Reputation points
    2022-04-22T05:06:14.153+00:00

    @ShivamDhiman-1582 thanks for the quick reply. Could you please share any API that might allow us to filter the rows based on a column value? FYI I know one such API which as per the documentation should work on tables, here is the documentation . But in our tests it did not work either, could you at least share one working payload for this API that shows the filter over column value, because the documentation does not have any payload for the API.