I'm attempting to use the following expression to replace the 'content' attribute in my OneNote page HTML, effectively setting the page creation timestamp before the page is created (because I can't find another way to do so). Please see below:
replace(string(body('Get_Template_Page_Contents')?['$multipart'][0]?['body']), '"2025-06-06T07:30:00.0000000"', string(parseDateTime(variables('currentDateTime'), 'en-AU', 'yyyy-MM-ddTHH:mm:ss.fffffff')))
The variable 'currentDateTime' is a string collected from a SharePoint item's 'Created' column. I'd then like to format that timestamp into the same format used in the OneNote HTML, then replace it.
The issue I'm facing is this:
Unable to process template language expressions in action 'Multipart_1_-_Body' inputs at line '0' and column '0': 'In function 'parseDateTime', the value provided for date time string '2025-06-12T01:47:58Z' was not valid. The datetime string must match ISO 8601 format.'.
I can't wrap my head around it as I'm sure that is correct ISO 8601 format. Am I horribly wrong or is there something else wrong with my expression that is causing this error?
Any help is greatly appreciated, thank you.