Reputation: 154
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:
data-tag
from to-do
to to-do:completed
0px
, and all data-tags
has been removedHere 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?
Upvotes: 1
Views: 728
Reputation: 538
Do not specify border in the style attribute. Just specify the border as the table cell attribute.
And thanks for using the OneNote APIs via Microsoft Graph!
Upvotes: 3
Reputation: 627
From this link at the bottom the Example block of HTML has info about how the OneNote-API handles tables.
Specifically borders will be hidden or displayed depending on the current setting for the page under "Table Tools" -> "Layout" -> "Hide Borders" toggle.
In terms of to-do boxes these have to be wrapped in a paragraph, for example:
<td><p data-tag="to-do:completed" data-id="oa">OA Check</p></td>
Upvotes: 1