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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate SharePo...
Power Automate
Answered

Power Automate SharePoint Page Content

(0) ShareShare
ReportReport
Posted on by 18
I have a Power App that is feeding two SharePoint lists in a parent child relationship (one to many). I am producing a Word Doc at the end that summarizes, in a narrative, all the data fields that were input by the user. That flow is working great. What I'm trying to do now is take a step back and produce each of the child narratives and port that to a SharePoint page. I only have a rudimentary template now, and I am trying to change the CanvasContent to update just two placeholder (text) fields.
 
My steps so far have brought me up to getting the data from the SharePoint list, getting the SP template (Send an HTTP request to SharePoint) and copying it, getting the newly created page, and checking it out. Using Co-Pilot, I've tried several different scenarios to update the CanvasContent, but all of them have failed. I did get close, but it blanked my page.
 
The step below gets a good output (status code 200), with the headers and body "d" that gives me the Id of the page with the CanvasContent1. The flow currently runs without errors. I need to know where to go from here. I've tried putting the CanvasContent1 into a compose, change what I need to change, and try to put it back in the body of Update. I've tried the same thing with setting a variable and use that for the body of my Update. I know the Update's (Send an HTTP Post) body needs to be in an appropriate JSON, but I've not been able to find what that proper format is supposed to be. Any help is greatly appreciated.
Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,851 Most Valuable Professional on at
     
    The appropriate format of json for your body depends on which (type) of sections you are using and which type of web parts. For example a text web part is way simpler to configure compared to a quick links web part.
     
    So, can you share the layout of your page and what you are trying to configure? This way we can steer you into to right direction.
     
    It would also be useful to see the payload of the CanvasContent1 you used before in testing, to get an idea of what didn't work.
     
     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, LinkedIn, Bluesky profile or Youtube Channel
  • KE-14051501-0 Profile Picture
    18 on at
    I gave you the full payload of a SavePage from my template. You will see the placeholder text [**Text**] for each of the fields I want to fill in the narrative. The page has a header with the Title, 'Business Impact Assessment for [**Department**]. There is a two-column section with the main section housing the narrative with all the placeholders in a text webpart. In the second column, there is a text webpart with the BIAs contact information.
     
    As I said before, I've tried a compose and a variable to get the placeholders filled in. I'm a bit worried about the 255-character limitation coming into play, as well. Thanks for your interest and willingness to help. At least it tells me I'm potentially not trying to do something that can't be done.
  • Verified answer
    Expiscornovus Profile Picture
    33,851 Most Valuable Professional on at

    I notice it contains a lot of HTML and CSS code as well. It might be related to encoding.
     
    My suggestion would be to start small. It is very easy to make a mistake in the json config. For example first start with a simple Text Web Part. And see if that works in your setup and than gradually keep adding more HTML, content and web parts to it.
     
    Below is an example of a simple payload for a text web part:
     
     
    {
      "__metadata": {
        "type": "SP.Publishing.SitePage"
      },
      "CanvasContent1":"[{\"controlType\":4,\"id\":\"ed2476c7-994a-4a07-a322-8afe873c05f2\",\"innerHTML\":\"<p>@{variables('Text')}<br></p>\",\"position\":{\"zoneIndex\":1,\"sectionIndex\":1,\"controlIndex\":0.5,\"sectionFactor\":8,\"layoutIndex\":1},\"addedFromPersistedData\":true}]",
      "Title": "Page with Text Web Part"
    }


     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, LinkedIn, Bluesky profile or Youtube Channel
  • KE-14051501-0 Profile Picture
    18 on at
    So, I guess my solution is to compose the HTML and insert it where you have "<p>@variables('Text')}<br></p>\". At least for the main body of the text, right? That gives me the bulk of what I want the page to accomplish. From there, I will just need to figure out where the header placeholder text is, and then try the other text block for contact information. It tested fine with your suggestions. I'll try some more stuff and report back.
  • Suggested answer
    KE-14051501-0 Profile Picture
    18 on at
    I have this fully working with the header, left and right columns.
     
    Just for posterity, I took the payload from SavePage (SavePageCoAuth in this case), and just extracted the following portion:
     
    {
       "__metadata":{
          "type":"SP.Publishing.SitePage"
    },
       "CanvasContent1": to the end of "Title":"Title text"}

    And from there, I found the header text, the text in the left column, and the text in the right column, and replaced it with variables I populated from compose actions. HINT: you can put straight HTML <p></p> code in the compose, then use it as the body output for your variables.
     
    Add the whole JSON to the body of your HTTP request to SavePage, and it works like a charm.
     
    Thanks so much for your assistance, !

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 801

#2
Valantis Profile Picture

Valantis 602

#3
Haque Profile Picture

Haque 581

Last 30 days Overall leaderboard