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 / Update canvasContent1 ...
Power Automate
Unanswered

Update canvasContent1 throws Bad Gateway Error

(0) ShareShare
ReportReport
Posted on by 3
Trying to update the document Library Folder path by updating the canvasContent1. The current Folder path points to a folder named "TempC" and I want to change that to another folder. Then name of the new folder is stored in variable named ChannelFolderName. 

This is my overall flow:

 
I get the canvasContent1 by a Pages request like this:
 
 
Then I use a Compose action called HTML to extract the canvasContent1 and perform the replace
 
 
 
 
 
This is the raw output of this Compose Action to update the canvasContent1
"[{\"position\":{\"layoutIndex\":1,\"zoneIndex\":1,\"zoneId\":.....(MORE CONTENT).....true,\"selectedListId\":\"4e84fed4-f368-49cc-8e71-226192715d2c\",\"selectedListUrl\":\"/sites/SESProjects/Shared Documents\",\"webRelativeListUrl\":\"/Shared Documents\",\"webpartHeightKey\":4,\"selectedViewId\":\"a7454b32-c85b-4868-a235-784976a6fb02\",\"selectedFolderPath\":\"CPT0304B\",\"selectedFolderKey\":\"id=%2Fsites%2FSESProjects%2FShared%20Documents%2FCPT0304B&listurl=%2Fsites%2FSESProjects%2FShared%20Documents\"},\"containsDynamicDataSource\":true}},{\"position\.....(MORE CONTENT).....\"isLowQualityImagePlaceholderEnabled\":true}}}]"
 
I then check out the page then I send a request to update the page adding my HTML Compose output to the body of the request and this is where I always get the Bad Gateway error:

 
 
 
 
This is the Raw input of this request to update the canvasContent1 and that fails every time. 
{
    "host": {
        "connectionReferenceName": "shared_sharepointonline",
        "operationId": "HttpRequest"
    },
    "parameters": {
        "dataset": "https://xxxxxxxx.sharepoint.com/sites/SESProjects/",
        "parameters/method": "POST",
        "parameters/uri": "_api/SitePages/Pages(52)/SavePage",
        "parameters/headers": {
            "Accept": "application/json;odata=verbose",
            "Content-Type": "application/json;odata=verbose",
            "If-Match": "*"
        },
        "parameters/body": "{\n  \"__metadata\": { \"type\": \"SP.Publishing.SitePage\" },\n  \"CanvasContent1\": \"[{\"position\":{\"layoutIndex\":1,\"zoneIndex\":1,\"zoneId\...(MORE CONTENT).......\"selectedListUrl\":\"/sites/SESProjects/Shared Documents\",\"webRelativeListUrl\":\"/Shared Documents\",\"webpartHeightKey\":4,\"selectedViewId\":\"a7454b32-c85b-4868-a235-784976a6fb02\",\"selectedFolderPath\":\"CPT0304B\",\"selectedFolderKey\":\"id=%2Fsites%2FSESProjects%2FShared%20Documents%2FCPT0304B&listurl=%2Fsites%2FSESProjects%2FShared%20Documents\"},\"containsDynamicDataSource\":true}}.......(MORE CONTENT).......LowQualityImagePlaceholderEnabled\":true}}}]\"\n}\n\n\n\n\n"
    }
}
 
The page does get checked out successfully, when my flow fails I always have to go back and discard the check out before my next test. Is my approach all wrong or is there something wrong with the way I edit the canvasContent1 or adding it to the body of the request?
 
I have the same question (0)
  • Expiscornovus Profile Picture
    33,853 Most Valuable Professional on at
     
    What Web Parts and Sections are on the page? Can you share the value which is used in the CanvasContent1 property?
     
    It would be useful to see that, this way we can troubleshoot a bit easier and find the root cause.


     
    Happy to help out 😁

    I share more #PowerAutomate and #SharePointOnline content on my Blog, LinkedIn, Bluesky profile or Youtube Channel
     
     
  • CU05030316-0 Profile Picture
    3 on at
    I did update my post with some additional details like the raw output of my Compose action that updates the canvasContent1 and the Request that updates the page. 

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 791

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 535

Last 30 days Overall leaderboard