Hi,
I want to post News items on SharePoint using PowerAutomate. As I am using different banners for different posts, I've chosen and succeeded in copying a selected template out of the templates to the site pages folder. This solves my earlier problem that custom created pages do not show the banner as a preview thumbnail.
Now after copying the template, I would like to update the content with a new title and some new content. This is how far I got.
But it does not seem to update the title and page content to 'something'. Interestingly enough, the flow runs successfully, but does not update anything:
Anyone has an idea on how to fix this?
Hi @RogierE,
Properties like TopicHeader & BannerImageUrl are on the same level as the CanvasContent1 property. I see you are missing those in your payload.
Most of these methods are either in Microsoft Learn docs or you can reverse engineer them by manually editing the page and having a look at the payload in your Developer toolbar in the Network tab.
I would also suggest to start having a look at the new Graph API pages methods:
Thanks again. It worked, and I learnt a lot about the api. Is there any reference page where I could look up all the possible functions in the API like "checkoutpage" and "Publish" for any future coding challenges ?
One thing though: it did not solve my original problem, that the thumbnail seems to break when you manually change the Canvascontent1.
check out the screen shot of my News Webpart
The "something" post where I used your procedure to change the content of the page misses a Thumbnail of the banner, whereas if i just copy the template and do not change the content, it stays. As you can see in the most recent post called "Template-***"
Any idea's on that? Did I maybe break something with this SavePage body ?
{"__metadata":{"type":"SP.Publishing.SitePage"},
"Title":"something",
"CanvasContent1": "[{\"controlType\":4,\"id\":\"a3205408-9b2c-4cc8-a5e2-db21c4142daf\",\"position\":{\"layoutIndex\":1,\"zoneIndex\":2,\"sectionIndex\":1,\"controlIndex\":1,\"sectionFactor\":12},\"addedFromPersistedData\":true,\"innerHTML\":\"something\"},{\"controlType\":0,\"pageSettingsSlice\":{\"isDefaultDescription\":true,\"isDefaultThumbnail\":true,\"isSpellCheckEnabled\":true}}]"}
Hi @RogierE,
Can you try a POST request with a checkout method just before the action with the SavePage? See if that makes a difference?
_api/sitepages/pages(276)/checkoutpage
And after the SavePage you could use another action with a POST request with the Publish method
_api/sitepages/pages(276)/Publish
Thank you for your quick reply! Trying that option led to an error code:
It is a freshly copied page, and so no one could be editing it. And I tried adding a delay of 10 seconds, which sometimes helps, but it didn't work. Any other suggestions?
Hi @RogierE,
Can you try the SavePage method with a POST request instead?
URI
_api/sitepages/pages(276)/SavePage
Headers
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose"
}
Michael E. Gernaey
179
Super User 2025 Season 1
David_MA
161
Super User 2025 Season 1
stampcoin
143