Forum Discussion
Auto generating new post/page in the SharePoint site from the item of SharePoint List
arine1901 You can do it with PowerAutomate using the Send an HTTP request to SharePoint action and then using the SharePoint REST API to populate your content.
There are a few steps to get it working.
- This video is pretty good: Create SharePoint Site Pages automatically with Power Automate - YouTube
- and this page is helpful too: Automate Modern SharePoint Page Creation Using Power Automate (c-sharpcorner.com)
Good luck!
- arine1901Oct 26, 2023Brass Contributor
Thanks for your recommendation!
I have followed the steps and adjusted my column type like this
But I always get error BadGateway on SavePageAsDraft step.
error message: "There was an error deserializing the object of type Microsoft.SharePoint.Publishing.SitePageFieldsData. Encountered unexpected character 'E'.\r\nclientRequestId: \r\nserviceRequestId: "
This is the json body{
"__metadata": {
"type": "SP.Publishing.SitePage"
},
"LayoutWebpartsContent": "[{\"id\":\"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788\",\"instanceId\":\"cbe7b0a9-3504-44dd-a3a3-0e5cacd07788\",\"title\":\"Title area\",\"description\":\"Title area description\",\"audiences\":[],\"serverProcessedContent\":{\"htmlStrings\":{},\"searchablePlainTexts\":{},\"imageSources\":{\"imageSource\":\"/_layouts/15/images/sleektemplateimagetile.jpg\"},\"links\":{},\"customMetadata\":{\"imageSource\":{}}},\"dataVersion\":\"1.4\",\"properties\":{\"imageSourceType\":2,\"title\":\"Test Article Template\",\"textAlignment\":\"Left\",\"showPublishDate\":true,\"authors\":[{\"id\":\"\",\"upn\":\"\",\"email\":\"\",\"name\":\"\",\"role\":\"-\"}],\"showTopicHeader\":false,\"authorByline\":[\"\"],\"layoutType\":\"NoImage\",\"topicHeader\":\"\",\"enableGradientEffect\":true,\"isDecorative\":true},\"containsDynamicDataSource\":false,\"reservedHeight\":159}]",
"CanvasContent1": "[{\"controlType\":4,\"id\":\"1212fc8d-dd6b-408a-8d5d-9f1cc787efbb\",\"position\":{\"controlIndex\":2,\"sectionIndex\":1,\"sectionFactor\":12,\"zoneIndex\":1,\"layoutIndex\":1},\"addedFromPersistedData\":true,\"innerHTML\":\"<p>@{triggerOutputs()?['body/Description']}</p>\"},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true,\"isSpellCheckEnabled\":true,\"globalRichTextStylingVersion\":0,\"rtePageSettings\":{\"contentVersion\":5},\"isEmailReady\":false}}]",
"AuthorByline": [],
"TopicHeader": "",
"BannerImageUrl": "/_layouts/15/images/sitepagethumbnail.png",
"Title": "@{triggerOutputs()?['body/Title']}"
}Could you help me for this?
Regards,Arine
- BalasahebKahatDec 15, 2023Copper ContributorI am also facing same issue. Did you guys find any solution on this issue?
- Sigi7Aug 12, 2024Brass Contributor
Hi,
if the substitution of "triggerOutputs" is working, the "E" has to be in the content of it?
The issue is that you have to quote several letters if you are using them in "innerhtml".
e.g. single double quote (") has to be written as (\\\"), backslash the same. can't provide a full list, so take care of special characters.
br Sigi