Make homepage

How to set an existing page as a homepage of a site in SharePoint Online using a Power Automate flow. Kudos to Thomas Rice for sharing this approach.

URI

_api/web/RootFolder

Headers

{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"X-HTTP-Method": "MERGE"
}

Body

{
"__metadata": { "type": "SP.Folder" },
"WelcomePage": "SitePages/New-Home-Page.aspx"
}

Screenshot with example

Sample data
WelcomePage – SitePages/New-Home-Page.aspx

makehomepage

Expected response

{
"statusCode":204,
"headers": {}
}

Copy/paste example

{"id":"ea419217-69f3-4ea0-869d-3973d97e0636","brandColor":"#036C70","connectionReferences":{"shared_sharepointonline":{"connection":{"id":"/exp_sharedsharepointonline_e5efa"}}},"connectorDisplayName":"SharePoint","icon":"https://connectoricons-prod.azureedge.net/releases/v1.0.1723/1.0.1723.3986/sharepointonline/icon.png","isTrigger":false,"operationName":"Send_an_HTTP_request_to_SharePoint","operationDefinition":{"type":"OpenApiConnection","inputs":{"host":{"connectionName":"shared_sharepointonline","operationId":"HttpRequest","apiId":"/providers/Microsoft.PowerApps/apis/shared_sharepointonline"},"parameters":{"dataset":"@parameters('SPO_SiteCollection_Comm1site (exp_SPO_SiteCollection_Comm1site)')","parameters/method":"POST","parameters/uri":"_api/web/RootFolder","parameters/headers":{"Accept":"application/json;odata=verbose","Content-Type":"application/json;odata=verbose","X-HTTP-Method":"MERGE"},"parameters/body":"{\n\"__metadata\": { \"type\": \"SP.Folder\" },\n\"WelcomePage\": \"SitePages/New-Home-Page.aspx\"\n}"},"authentication":{"type":"Raw","value":"@json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"}},"runAfter":{},"metadata":{"operationMetadataId":"49282138-ec01-4197-a72a-be0cd53d5f48"}}}

Resources

Use Power Automate to Set a Page as the Home Page

That’s it, Happy testing!

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.