0

I'm very new at working with SharePoint, however I was tasked with setting up a News feed for my intranet site

My solution uses Power Automate

I set up an RSS feed to pull from, then I take the incoming items and add them to my News List

I also link certain Forms responses to the same News List

Then I add a trigger on my New List to create a custom page whenever a new Item comes to my News List

All this works, however my issue is that my newly created pages show up without the thumbnail in my webpart (even though they have a banner) I've spent the last few days trying to figure out what is going on and how to fix this

This is my CreatePost action URI: _api/sitepages/pages/

This is my request body:

{
"__metadata": {
    "type": "SP.Publishing.SitePage"
},
"Title": "@{triggerBody()?['Title']}",
"Name": "@{triggerBody()?['Title']}.aspx",
"PromotedState": 2,
"LayoutWebpartsContent": "[{\"id\":\"the-id\",\"instanceId\":\"the-instance-id\",\"title\":\"Title area\",\"description\":\"Title Region Description\",\"audiences\":[],\"serverProcessedContent\":{\"htmlStrings\":{},\"searchablePlainTexts\":{},\"imageSources\":{\"imageSource\":\"https://cdn.hubblecontent.osi.office.net/m365content/publish/005e1cee-d011-464c-9eff-fddfc42120f1/92919564.jpg\"},\"links\":{},\"customMetadata\":{\"imageSource\":{\"width\":2560,\"height\":1920}}},\"dataVersion\":\"1.4\",\"properties\":{\"title\":\"@{triggerBody()?['Title']}\",\"imageSourceType\":2,\"layoutType\":\"FullWidthImage\",\"textAlignment\":\"Left\",\"showTopicHeader\":false,\"showPublishDate\":false,\"topicHeader\":\"\",\"enableGradientEffect\":true,\"isDecorative\":true,\"authors\":[],\"authorByline\":[],\"imgHeight\":1920,\"imgWidth\":2560},\"containsDynamicDataSource\":false,\"reservedHeight\":228}]",
"BannerImageUrl": "https://cdn.hubblecontent.osi.office.net/m365content/publish/005e1cee-d011-464c-9eff-fddfc42120f1/92919564.jpg",
"CanvasContent1": "[{\"controlType\": 4, \"id\": \"the-id\", \"position\": {\"controlIndex\": 1, \"sectionIndex\": 1, \"sectionFactor\": 12, \"zoneIndex\": 1, \"layoutIndex\": 1}, \"innerHTML\": \"<div style=\\\"display: flex;justify-content: center;flex-direction: column;\\\"> <div style=\\\"text-align: center;\\\"> <h1>@{triggerBody()?['Title']}</h1> </div> <div style=\\\"display: flex;justify-content: center;width: 400px;\\\"> <img src='https://rohandeuskar.com/wp-content/uploads/2015/08/HelloWorld.png' alt=\\\"My img\\\"> </div> <div style=\\\"margin-top: 300px;text-align: center;\\\"> <p>@{triggerBody()?['content']}</p> </div> </div>\",\"addedFromPersistedData\":true}, {\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true,\"isSpellCheckEnabled\":true,\"globalRichTextStylingVersion\":0,\"rtePageSettings\":{\"contentVersion\":5},\"isEmailReady\":false}}]"

}

This is how I am able to create a new page with custom HTML

My next action is to checkin the page Then publish the page

Any help or points on where to improve would be of great help

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.