Forum Discussion

dtorres1800's avatar
dtorres1800
Copper Contributor
Aug 05, 2020

Stale Data on Excel File Download

We are having an issue where we are updating an Excel file in one drive via Microsoft Graph and then downloading the same file using the Graph Files APIs, the file downloaded has stale data. It has a copy of the data before the update that was sent via the excel API. I am using excel in Sessionless mode to ensure all the data is saved to the file and not a session. Current steps:

 

1.) Create (or upload) excel file into onedrive.

2.) Update a cell in the excel file created from step 1  via Microsoft Graph API in session less mode

3.) Using Microsoft Graph API download the updated excel from from step 2

4.) View downloaded file and see it is the incorrect data that matches the excel book in step 1 (before the update in step 2)

5.) View the file in onedrive via Excel Online, and it is correctly showing the updates from step #2

6.) Wait 2+ minutes and download the file again - it will now show the correctly updated file

 

Is there any way to force an update to the onedrive Excel file after the updates in step #2?  The time needed to wait in step #6 seems dependent on the size of the file, but I have seen it take 2+ minutes to refresh, sometimes it will be refreshed in under 1 minute.

 

Any help or tips and tricks on how to force the file on the server to refresh so the download will not incorrectly show stale data is much appreciated. I have no idea the upper bound on the time it takes to refresh, and 2 minutes is just a guess.

 

 

No RepliesBe the first to reply

Resources