I have created a Flow using the default template "Save a message to OneNote" and that works perfectly. The issue I am having is that I would like to modify the content that is dumped into OneNote.
Specifically, I would like the automation to post the Date/Time stamp of the Teams Message being "saved" into the OneNote note body. I cannot see a way to do this with the Dynamic Content, maybe there is a way to do this with expressions? Right now, my "hack" is to manually add this into the"myNote" popup when triggering the automation.
Here is the Flow's OneNote "Create a page in a section" code config:
{
"inputs": {
"host": {
"connectionName": "shared_onenote",
"operationId": "CreatePageInSection",
"apiId": "/providers/Microsoft.PowerApps/apis/shared_onenote"
},
"parameters": {
"notebookKey":REDACTED,
"sectionId": REDACTED,
"pageContent": "<html><head><title>Message from @{triggerBody()?['teamsFlowRunContext']?['messagePayload']?['from']?['user']?['displayName']}</title></head><body><p>Message from @{triggerBody()?['teamsFlowRunContext']?['messagePayload']?['from']?['user']?['displayName']} saved from Teams<br><br>Message details: <br>MessageID=@{triggerBody()?['teamsFlowRunContext']?['messagePayload']?['id']}<br>@{triggerBody()?['teamsFlowRunContext']?['messagePayload']?['body']?['content']}<br><br><br>Notes:<br>@{triggerBody()?['cardOutputs']?['myNote']}<br><br><a href=\"@{triggerBody()?['teamsFlowRunContext']?['messagePayload']?['linkToMessage']}\">Link to message</a></p></body></html>"
},
"authentication": {
"type": "Raw",
"value": "@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"
}
},
"metadata": {
"operationMetadataId": "983f0072-de7f-4a40-885a-65155b67042f"
}
}