How to update a specific row of a table in Excel using Microsoft Graph?

I am trying to update a specific row of a table in Excel using Microsoft Graph.

I didn't find any document in the table section .

For example, I want to update row # 6 (index 5).

Is there a way? Thanks to

PATCH:
https://graph.microsoft.com/beta/me/drive/items/12345/workbook/tables/Table1/rows/update

{
  "index": 5,
  "values": [
    [1, 2, 3]
  ]
}

      

+3


source to share


1 answer


You can correct the table row as shown below. This example updates row 2 (index = 1) of a table that contains 4 columns. Note that the index value is 0-indexed, and the header row here is not part of the row collection.

PATCH https://graph.microsoft.com/v1.0/me/drive/root:/nameditemtest.xlsx:/workbook/worksheets/sheet1/tables/Table1/rows/$/ItemAt(index=1)

{
 "values": [
        [
            "A",
            "B",
            "C",
            "D"
        ]]
}

      



Result: enter image description here

If you want to fix the header row, you can fix the base class values

with the path of the PATCH ../tables/{id|name|}/rows/$/ItemAt(index={index}/headerRowRange

-OR- update property of the name

table column using the pathPATCH ../tables/{id|name}/columns/{id}

+1


source







All Articles