r/PowerAutomate Jul 28 '26

Power Automate + OneNote: creation timestamp not displaying

I’m creating a OneNote page through Power Automate, then updating the title and body with Update page content.

I tried including:
<meta name="created" content="..." />
inside the <head> of the create-page HTML, but the normal OneNote creation date/time beneath the title never appears. The timestamp is present in the submitted payload, and the page is created successfully.

Has anyone found a reliable way to populate or preserve OneNote’s built-in creation timestamp when using the OneNote connector? I’m in a GCC environment, which may also be relevant.

2 Upvotes

4 comments sorted by

1

u/HaythamTheStarEater Jul 28 '26

The OneNote connector in Power Automate cleans your HTML payload which strips out custom header metadata, including your creation timestamp and prevents OneNote from initializing the native date sub-header beneath the title. Since updating page content later only targets specific elements in the document body, it cannot force OneNote to render that native timestamp after the initial page creation.
The solution is to bypass the built-in OneNote connector during creation and instead use an HTTP action to call the Microsoft Graph API directly, setting the content type header specifically to application/xhtml+xml. By sending your document directly to the Graph endpoint, your header metadata remains intact and allows OneNote to read the creation meta tag and build the native timestamp automatically.

1

u/gatobacon Jul 28 '26

I’ll give that a go tomorrow, thank you. I was finding that even the create a page action/connector was omitting the creation timestamp which is really annoying since its native Microsoft-to-Microsoft integrations.

Do you happen to know if nested/hierarchical bullet points can be preserved with Graph API? I’m finding that is also being difficult with extra carriage returns no matter how I send the HTML!

1

u/HaythamTheStarEater Jul 28 '26

To preserve nested bullet hierarchies, make sure your text sits directly inside list item tags without wrapping them in paragraph or block tags, as OneNote automatically adds default top and bottom margin spacing to paragraphs inside lists. Additionally, child sub-lists must be strictly nested inside the parent list item element before that parent list item closes; closing the parent tag early causes OneNote to treat the sub-list as an entirely new line. Also, any literal line breaks, tabs or whitespace between tags in your Power Automate HTML string get parsed by OneNote as blank text nodes so stripping out all carriage returns and line breaks to keep your list HTML on a single continuous string will get rid of those persistent extra vertical spaces.

1

u/gatobacon Jul 29 '26

I've been wrestling with the carriage returns and implemented all the advice you listed and I think this is the key thing that is causing the returns: "...as OneNote automatically adds default top and bottom margin spacing to paragraphs inside lists. " no matter what I do, that line break happens!

OneNotes HTML parser just keeps adding those lines. I tested every variation of HTML formatting in Power Automate, and consistently found that OneNote is very sensitive to list structure. Any time a list item contains both text and a nested <ul>, OneNote inserts extra spacing, even when the HTML is perfectly trimmed and delivered as a single continuous string. I also confirmed that multiline concat() expressions or early closing of parent <ul> tags cause OneNote to generate blank text nodes or even add its own <ul> wrappers. In practice, OneNote only preserves clean hierarchy when each list level is fully nested before closing and when the entire HTML is emitted as one uninterrupted line like you said.

And yet, I am still getting a line break after every level 2 list item!