I have an OneNote page with table of tasks: First column is a task name with to-do tag (checkbox), and second column with description. The table has been created from OneNote web UI (OneNote online).
I want to mark tasks completed via Graph API. According documentation I can update table content only by replacing whole table. But after update my table does not have borders anymore, and all to-do tags (checkboxes) are missing.
Workflow:
- Get page content (docs, response)
- Take table from content, find required task, replace
data-tag
fromto-do
toto-do:completed
- Get page content with generated IDs (docs, response) to find target table id
- Send PATCH request to replace the table (request - response)
- Table became replaced but all border has been set to
0px
, and alldata-tags
has been removed
Here is a formatted value of content field of PATCH request payload (raw request here):
<table style="border:1px solid;border-collapse:collapse">
<tr>
<td style="border:1px solid"><span style="font-weight:bold">Task</span></td>
<td style="border:1px solid"><span style="font-weight:bold">Comment</span></td>
</tr>
<tr>
<td style="border:1px solid"><span data-tag="to-do:completed">Update todo in table</span></td>
<td style="border:1px solid">There are some issues when we updating todos located inside of tables</td>
</tr>
</table>
What is wrong with my PATCH request?