Problems Creating and Updating Rows in Excel Spreadsheet via Microsoft Graph API: Endpoint Help and Call Example

2023-08-21T13:43:24.7266667+00:00

Hello,

I'm having trouble creating and updating rows in an Excel spreadsheet using the Microsoft Graph API. I would like to know what is the correct API to perform this procedure and, if possible, receive an example call to do this.

I'm currently using the Microsoft Graph API to interact with my files on OneDrive, including Excel spreadsheets. However, I'm running into issues when I try to create or update rows within the worksheet. I'm not sure which specific endpoint I should use and how to properly structure the request.

If anyone can provide me with guidance on which endpoint to use, what parameters to pass in the request, and how to properly format the data, that would be a huge help. An example call using cURL or any other language would be greatly appreciated.

Thank you in advance for any help and guidance you can provide me!"

This way, you can get specific help and guidance from the Microsoft Graph community to solve your problem of creating and updating rows in an Excel spreadsheet using the Microsoft Graph API. Be sure to include enough detail so that other members can understand your situation and provide helpful answers.

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ab-8756 805 Reputation points
    2023-08-21T20:11:35+00:00

    Hello Guilherme Henrique Dos Santos Nascimento,
    Thank you for reaching out to this Q&A forum.

    To create and update raw you can use the below endpoint;-

    https://graph.microsoft.com/v1.0/me/drive/items/01DLDARAVPSYF3IMDZJZCISWNBLJ4FJZ3J/workbook/worksheets('sheet1')/range(address='A3:C3')
    
    In the Body you can add the value;-
    
    
    {
        "values": [
            [
                "A1",
                "B1",
                "C1"
            ]
        ]
    }
    
    

    This endpoint will add the above values to row in the A3:C3 location.
    User's image

    Here is the reference article;- https://learn.microsoft.com/en-us/graph/api/resources/excel?view=graph-rest-1.0

    Hope that helps.
    Thanks
    --please don't forget to upvote and Accept as answer if the reply is helpful—

    0 comments No comments

  2. Guilherme Henrique Dos Santos Nascimento 0 Reputation points
    2023-08-21T20:25:01.6966667+00:00

    Thank you very much for the feedback, it worked.

    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.