Issue while reading excel file from sharepoint Via graph API

Anumalasetti, Naveen 0 Reputation points
2025-01-07T04:36:46.0866667+00:00

Hi Team,

I am reading an excel file that has multiple sheets from a standalone sharepiont site. While reading it the data inside the sheets is not being read rather it is coming empty columns.

While debuggint the issue I observed a behaviour where by deleting few of the sheets I was able to get the columns and data inside it. But based on my understanding each sheet is trated as a independent entiry and there will be no dependency between them.

So I was not able to understand how other sheets will effect the actual sheet I want to read. My request is I want to understand what are the limitations while reading excel sheets from sharepoint via graph API.

URL being used:- https://graph.microsoft.com/v1.0/sites/**/drives/**/root:/EU Brand Pulse Data - Temporary Test Folder/Europe/Market Access Data/Test Market Access Data Collection.xlsx:/content

Also I was not able to understand how the hidden sheets and the other sheets with different schema are effecting the actual sheet I want to read!!!

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,717 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,170 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Saranya Madhu-MSFT 920 Reputation points Microsoft Vendor
    2025-01-07T07:22:00.0633333+00:00

    Hi Anumalasetti, Naveen,

    Thanks for reaching out to Microsoft!

    I attempted to retrieve the content of an Excel file from SharePoint using the Microsoft Graph API

    GET https://graph.microsoft.com/v1.0/sites/{SITEID}/drives/{DRIVEID}/root:/pathToitem:/ after deleting one of the sheets. The response was successful, and Microsoft Graph API was used to retrieve the dowloadURL of the Excel file, and there were no discrepancies in the data from the remaining sheets.

    Note: Please ensure that the sheets do not have lookup columns which will lead to issues in getting the empty results.

    Working with Excel in Microsoft Graph 

    Hope this helps.

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


  2. Ling Zhou_MSFT 20,090 Reputation points Microsoft Vendor
    2025-01-07T08:53:11.8933333+00:00

    Hi @Anumalasetti, Naveen,

    Thanks for your detailed explanation, I am more than willing to help you out.

    Based on the information you provided and based on this documentation, it appears that the Graph API request you are using is to download the document rather than read it.

    User's image

    User's image

    If you need to read data from a table in an excel file, you can use this Graph API request.

    If you confirm that you are using right request, then we would like you to perform the following tests and provide more details about the problem, which is essential for further investigation as it can help us better determine the root cause of the problem:

    1. I checked the documentation, and the Graph API does not specify a limit on the number of worksheets in an excel file, but some users have mentioned that if there are too many worksheets it can cause errors. So, you can try creating an excel file with fewer worksheets to see if the problem still exists. Simplifying the file by reducing the number of worksheets or splitting the data into multiple files might help.
    2. Are you having the same problem with other users performing the same request with the same file?
    3. Please share the response to your request if it's convenient, I would like to know the specifics of the columns you mentioned and the data being empty. Please be careful not to disclose your private information.

    If there is anything else I can do for you, please do not hesitate to reach me.


  3. Ling Zhou_MSFT 20,090 Reputation points Microsoft Vendor
    2025-01-08T08:38:36.0466667+00:00

    Hi @Anumalasetti, Naveen,

    Appreciate for letting us know your experience.

    Concerning the issue you mentioned, we have looked for relevant documentation and feedback from other users on similar situations, but there is no definitive answer.

    Therefore, we are not sure if an excel file containing empty sheets will cause the entire file to return empty results when request this Graph API.

    We have noticed that you seem to be able to resolve the issue by simply deleting your empty sheets. If this issue is not affecting you now, you can ignore this behavior.

    If you would like to confirm whether this is the expected behavior of the Graph API, it is recommended that you open a ticket for further confirmation. Engineers there have access to more information than in the forums and may be able to confirm whether the issue is expected behavior.

    If you have any concerns or questions, please do not hesitate to reach me.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. It will be beneficial to more community members reading here. Your contribution will be highly appreciated.

    0 comments No comments

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.