
Announcements
Hello,
I'm new to Power Automate and I'm curious if there's a way to extract the contents of a One Note notebook - I mean all the text from every page and section - and then upload it onto a SharePoint site that's structured similarly to the One Note. This isn't a must-do task, but I've noticed that opening SharePoint on a mobile device and then trying to access the One Note file makes it really tough to read anything in the One Note.
Hi @Andii,
Technically it would be possible. The challenge is probably to map all the elements within the OneNote page content to SharePoint Web Parts.
Extracting Text and adding it to a page should be a good starting point.
Embedded images and other type of content might be more challenging 😁
Below is a example of a approach.
In this example I am only using Text content of the page and map it to a Text Web Part on a newly created (draft) SharePoint Online page.
1. A page in OneNote, with just text.
2. The flow setup which creates a (draft) page with a text web part which includes the text content of the page
a. First HTTP request
URI
_api/sitepages/pages
Body
{"__metadata":{"type":"SP.Publishing.SitePage"},"PageLayoutType":"Article","PromotedState":0}
b. Second HTTP request
URI
_api/sitepages/pages(@{body('Send_an_HTTP_request_to_SharePoint')['d']['Id']})/SavePage
Body
{
"__metadata": {
"type": "SP.Publishing.SitePage"
},
"CanvasContent1": "[{\"controlType\":4,\"id\":\"ed2476c7-994a-4a07-a322-8afe873c05f2\",\"innerHTML\":\"<p>@{body('Html_to_text')}<br></p>\",\"position\":{\"zoneIndex\":1,\"sectionIndex\":1,\"controlIndex\":0.5,\"sectionFactor\":8,\"layoutIndex\":1},\"addedFromPersistedData\":true}]",
"Title": "Page with Text Web Part"
}
3. The end result in my test