Steps done using Graph Explorer - https://developer.microsoft.com/en-us/graph/graph-explorer
- Create a new non-persistent session for the workbook
POST
https://graph.microsoft.com/v1.0/me/drive/items/{itemId}/workbook/createSession
{
"persistChanges": false
}
- Use the session as HTTP header (in all the subsequent calls)
"workbook-session-id": "<non-persistent-session-id>"
- Send Input values - note in this case we are just updated a single input cell, this can be a range e.g. C3:C7 well, in which case the values would be
[["valC3", "valC4", "valC5", "valC6", "valC7"]]
. Also number format can be specified using the attribute e.g."numberFormat"
for each cell.
PATCH
https://graph.microsoft.com/v1.0/me/drive/items/{itemId}/workbook/worksheets('InputOutput')/range(address='C3')
{
"values" : [["230"]]
}
- Read the output values
GET
https://graph.microsoft.com/v1.0/me/drive/items/{itemId}/workbook/worksheets('InputOutput')/range(address='C9:C11')