How do we fetch the latest data using ms graph usedRange API?

Shubham Sharma 1 Reputation point
2022-08-09T11:05:05.123+00:00

We have a workflow, where we do a PATCH request and update the data in an excel worksheet
The excel is having some formulas applied which changes the values in multiple places due to the PATCH request.

Now what we like to do is fetch the latest data from excel which is updated after the PATCH request.
* We want to have this data instantly after update.

Currently the graph api does not return this latest data instantly, instead it takes around 30-40 seconds to reflect the latest data.

If this can get quicker, it would help us.

Microsoft Security Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. Zehui Yao_MSFT 5,876 Reputation points
    2022-08-10T10:25:24+00:00

    Hi @Shubham Sharma , as I can't sure your data vol, so I can't fully reproduce your question,
    I recommend try use the session header workbook-session-id: {session-id} Enter non-persistent session mode by API:
    POST https://graph.microsoft.com/v1.0/me/drive/items/{item-id}/workbook/createSession
    to see if it can improve performance. Hope it can help you, best regards.

    Documentation for your reference:
    https://learn.microsoft.com/en-us/graph/api/resources/excel?view=graph-rest-1.0
    https://learn.microsoft.com/en-us/graph/api/workbook-createsession?view=graph-rest-1.0&tabs=http

    229946-image.png
    229904-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


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.