web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Updating SharePoint Pa...
Power Automate
Unanswered

Updating SharePoint Page content SharePoint API

(0) ShareShare
ReportReport
Posted on by 875 Moderator

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. 

RogierE_0-1672831615159.png

 

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:

RogierE_1-1672831753044.png

Anyone has an idea on how to fix this? 

 

Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    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"
    }

     

     

     

     

     

  • RogierE Profile Picture
    875 Moderator on at

    Thank you for your quick reply! Trying that option led to an error code: 

    RogierE_0-1672839823884.png

    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? 

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    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

     

  • RogierE Profile Picture
    875 Moderator on at

    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

    RogierE_0-1672844426792.png

    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}}]"}

     

  • Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at

    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:

    https://devblogs.microsoft.com/microsoft365dev/announcing-the-new-sharepoint-pages-api-in-microsoft-graph/

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard