Hiding the SharePoint page title with Power Automate

Published Sep 14 2021 06:30 AM 800 Views
Occasional Contributor

For any SharePoint modern page that you create manually, there will always be a page title that you cannot remove using the SharePoint UI at the moment.

 

page-title.png

The logic behind those options is that on the background they change a hidden field in the Page, which is the PageLayoutType field. This field is not exposed through the UI but is accessible and editable through the SharePoint REST API.

 

If the data is accessible and editable through the SharePoint REST API, we can manipulate it using a Power Automate flow.

 

The idea behind the flow

 

To be able to remove the page title using a flow as mentioned above, the main idea is to build a flow that simply switches the page layout by updating the PageLayoutType field.

 

If it is a normal page (Article), this flow will switch it to a page with the home page layout (no title), and vice versa (in case there is a need to show the title again).

 

running-flow.gif

 

So we want to make this flow available from the library UI, and for this to happen we need to use the SharePoint flow Trigger: For a Selected File.

 

Select the site you want to use this functionality. And add the library too.

 

for-a-selected-file.png

 

Note that the Pages Library is not listed on the options for the triggers, however, you can add the list manually by adding its id (GUID), which can be found on the library settings page URL:

 

list id.PNG

 

Accessing Page Data

 

For the next steps, we need to use data returned by the flow trigger to be able to get the current page layout and list item Id from the current page.

 

First, manipulate the page relative URL+ site id from data returned by the Flow’s trigger.

 

Initialise one variable called PageUrl and set it to the property ‘itemUrl‘, gathered from the flow’s trigger:

 

PageURL.PNG

 

Then initialise two variables using the following expressions as value (their values are simply set by manipulating the page full URL by splitting it and getting the right piece of the string):

 

SiteURL: split(variables(‘PageUrl’),’SitePages’)[0]

 

PagePath: split(variables(‘PageUrl’),’sharepoint.com’)[1]

 

vars.PNG

 

Then you can make a call using REST API to the GetFileByServerRelativeUrl endpoint to retrieve the list item fields for the current page (explicitly selecting the PageLayoutType field, otherwise, it wouldn’t be returned):

 

send an http get data.PNG

 

Use the Parse JSON action with the schema below to facilitate accessing the properties:

 

 

 

 

 

 

{
    "type": "object",
    "properties": {       
        "Title": {
            "type": "string"
        },
        "PageLayoutType": {
            "type": "string"
        },
        "ID": {
            "type": "integer"
        }
    }
}

 

 

 

 

 

 

And initialise a new variable called PageLayout, having the PageLayoutType parsed from the JSON content as value:

 

parse json.PNG

 

Updating the Page Layout

 

Based on the current page layout value, you can update the variable value to the other desired (if it is Home, you should update it to Article, if it is Article you should update it to Home.

 

switch value.PNG

 

And then send a PATCH HTTP request to SharePoint to update the current page field:

 

patch.PNG

 

Results

 

When you execute the flow, it will switch the page layout as below. If you execute it again, it will switch back to the previous layout (from Article to Home or from Home to Article):

 

running-flow.gif

 

 

Reusing the flow in other Page Libraries

 

If you built the flow as demonstrated above, it will be getting the site and library dynamically based on the trigger values. So, it can be reused in more libraries using list formatting.

 

Simply add the column formatting JSON below (sample edited from Microsoft 365 PnP repository) to a dummy calculated column with fixed text in other pages library (use the calculated column, so it is hidden from forms).

 

Replace the id on the ActionParams property with your Flow ID, and by clicking the button added to this column with the JSON formatter, the same flow will be called as if it was triggered from the Automate menu.

 

 

 

 


  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "button",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"a9dcaeec-61f9-4dd1-9561-679b15bc3e22\"}"
  },
  "attributes": {
    "class": "ms-fontColor-themePrimary ms-fontColor-themeDarker--hover"
  },
  "style": {
    "border": "none",
    "background-color": "transparent",
    "cursor": "pointer"
  },
  "children": [
    {
      "elmType": "span",
      "attributes": {
        "iconName": "ChangeEntitlements"
      },
      "style": {
        "padding-right": "6px"
      }
    },
    {
      "elmType": "span",
      "txtContent": "Switch Layout"
    }
  ]
}

 

 

 

 

To find your Flow id, just check the URL used when you edit it:

 

flow id.PNG

 

You can then start it normally from any other Site Pages library in the tenant, where you add the column with the JSON formatting calling the flow:

 

switch_flow.PNG

 

If you run the flow from a library where it was called using only the formatter, the values will be parsed correctly from the trigger and the flow will be executed successfully, as the JSON format button sends data related to the currently selected file and we run the rest of the flow dynamically based on the values sent by the trigger.

%3CLINGO-SUB%20id%3D%22lingo-sub-2747412%22%20slang%3D%22en-US%22%3EHiding%20the%20SharePoint%20page%20title%20with%20Power%20Automate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2747412%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EFor%20any%20SharePoint%20modern%20page%20that%20you%20create%20manually%2C%20there%26nbsp%3Bwill%20always%20be%20a%20page%20title%20that%20you%20cannot%20remove%20using%20the%20SharePoint%20UI%20at%20the%20moment.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22page-title.png%22%20style%3D%22width%3A%20965px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310146iE3D512D2732ED5E1%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22page-title.png%22%20alt%3D%22page-title.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20logic%20behind%20those%20options%20is%20that%20on%20the%20background%20they%20change%20a%20hidden%20field%20in%20the%20Page%2C%20which%20is%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EPageLayoutType%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efield.%20This%20field%20is%20not%20exposed%20through%20the%20UI%20but%20is%20accessible%20and%20editable%20through%20the%20SharePoint%20REST%20API.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20the%20data%20is%20accessible%20and%20editable%20through%20the%20SharePoint%20REST%20API%2C%20we%20can%20manipulate%20it%20using%20a%20Power%20Automate%20flow.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EThe%20idea%20behind%20the%20flow%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20be%20able%20to%20remove%20the%20page%20title%20using%20a%20flow%20as%20mentioned%20above%2C%20the%20main%20idea%20is%20to%20build%20a%20flow%20that%20simply%20switches%20the%20page%20layout%20by%20updating%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EPageLayoutType%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Efield.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20it%20is%20a%20normal%20page%20(Article)%2C%20this%20flow%20will%20switch%20it%20to%20a%20page%20with%20the%20home%20page%20layout%20(no%20title)%2C%20and%20vice%20versa%20(in%20case%20there%20is%20a%20need%20to%20show%20the%20title%20again).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22running-flow.gif%22%20style%3D%22width%3A%20800px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310147i9905827E43AC6BD0%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22running-flow.gif%22%20alt%3D%22running-flow.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESo%20we%20want%20to%20make%20this%20flow%20available%20from%20the%20library%20UI%2C%20and%20for%20this%20to%20happen%20we%20need%20to%20use%20the%20SharePoint%20flow%20Trigger%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EFor%20a%20Selected%20File%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESelect%20the%20site%20you%20want%20to%20use%20this%20functionality.%20And%20add%20the%20library%20too.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22for-a-selected-file.png%22%20style%3D%22width%3A%20609px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310149i401F865C80876E23%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22for-a-selected-file.png%22%20alt%3D%22for-a-selected-file.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ENote%20that%20the%20Pages%20Library%20is%20not%20listed%20on%20the%20options%20for%20the%20triggers%2C%20however%2C%20you%20can%20add%20the%20list%20manually%20by%20adding%20its%20id%20(GUID)%2C%20which%20can%20be%20found%20on%20the%20library%20settings%20page%20URL%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22list%20id.PNG%22%20style%3D%22width%3A%20603px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310151i599C5B27707D9B79%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22list%20id.PNG%22%20alt%3D%22list%20id.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EAccessing%20Page%20Data%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20the%20next%20steps%2C%20we%20need%20to%20use%20data%20returned%20by%20the%20flow%20trigger%20to%20be%20able%20to%20get%20the%20current%20page%20layout%20and%20list%20item%20Id%20from%20the%20current%20page.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFirst%2C%20manipulate%20the%20page%20relative%20URL%2B%20site%20id%20from%20data%20returned%20by%20the%20Flow%E2%80%99s%20trigger.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EInitialise%20one%20variable%20called%20PageUrl%20and%20set%20it%20to%20the%20property%20%E2%80%98%3CSTRONG%3EitemUrl%3C%2FSTRONG%3E%E2%80%98%2C%20gathered%20from%20the%20flow%E2%80%99s%20trigger%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22PageURL.PNG%22%20style%3D%22width%3A%20614px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310152i99A484C84B9EF99E%2Fimage-dimensions%2F614x188%3Fv%3Dv2%22%20width%3D%22614%22%20height%3D%22188%22%20role%3D%22button%22%20title%3D%22PageURL.PNG%22%20alt%3D%22PageURL.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThen%20initialise%20two%20variables%20using%20the%20following%20expressions%20as%20value%20(their%20values%20are%20simply%20set%20by%20manipulating%20the%20page%20full%20URL%20by%20splitting%20it%20and%20getting%20the%20right%20piece%20of%20the%20string)%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESiteURL%3C%2FSTRONG%3E%3A%20split(variables(%E2%80%98PageUrl%E2%80%99)%2C%E2%80%99SitePages%E2%80%99)%5B0%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EPagePath%3A%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Esplit(variables(%E2%80%98PageUrl%E2%80%99)%2C%E2%80%99sharepoint.com%E2%80%99)%5B1%5D%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22vars.PNG%22%20style%3D%22width%3A%20616px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310154iDF31D10FF9D23121%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22vars.PNG%22%20alt%3D%22vars.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThen%20you%20can%20make%20a%20call%20using%20REST%20API%20to%20the%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EGetFileByServerRelativeUrl%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3Eendpoint%20to%20retrieve%20the%20list%20item%20fields%20for%20the%20current%20page%20(explicitly%20selecting%20the%20PageLayoutType%20field%2C%20otherwise%2C%20it%20wouldn%E2%80%99t%20be%20returned)%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22send%20an%20http%20get%20data.PNG%22%20style%3D%22width%3A%20608px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310155i440CBA25A125730F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22send%20an%20http%20get%20data.PNG%22%20alt%3D%22send%20an%20http%20get%20data.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EUse%20the%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EParse%20JSON%3C%2FSTRONG%3E%3CSPAN%3E%26nbsp%3Baction%20with%20the%20schema%20below%20to%20facilitate%20accessing%20the%20properties%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%20%20%22type%22%3A%20%22object%22%2C%0A%20%20%20%20%22properties%22%3A%20%7B%20%20%20%20%20%20%20%0A%20%20%20%20%20%20%20%20%22Title%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22string%22%0A%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%22PageLayoutType%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22string%22%0A%20%20%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%20%20%22ID%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%22type%22%3A%20%22integer%22%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAnd%20initialise%20a%20new%20variable%20called%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EPageLayout%3C%2FSTRONG%3E%3CSPAN%3E%2C%20having%20the%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EPageLayoutType%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3Eparsed%20from%20the%20JSON%20content%20as%20value%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22parse%20json.PNG%22%20style%3D%22width%3A%20614px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310157iA4F6E2A5FD9734DB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22parse%20json.PNG%22%20alt%3D%22parse%20json.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EUpdating%20the%20Page%20Layout%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBased%20on%20the%20current%20page%20layout%20value%2C%20you%20can%20update%20the%20variable%20value%20to%20the%20other%20desired%20(if%20it%20is%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EHome%3C%2FSTRONG%3E%2C%20you%20should%20update%20it%20to%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EArticle%3C%2FSTRONG%3E%2C%20if%20it%20is%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EArticle%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3Eyou%20should%20update%20it%20to%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EHome%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22switch%20value.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310158i1C42AE3C7A770BA2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22switch%20value.PNG%22%20alt%3D%22switch%20value.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAnd%20then%20send%20a%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EPATCH%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3E%3CSPAN%3EHTTP%20request%20to%20SharePoint%20to%20update%20the%20current%20page%20field%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22patch.PNG%22%20style%3D%22width%3A%20614px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310159iEE0134A3E2598812%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22patch.PNG%22%20alt%3D%22patch.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EResults%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhen%20you%20execute%20the%20flow%2C%20it%20will%20switch%20the%20page%20layout%20as%20below.%20If%20you%20execute%20it%20again%2C%20it%20will%20switch%20back%20to%20the%20previous%20layout%20(from%20Article%20to%20Home%20or%20from%20Home%20to%20Article)%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22running-flow.gif%22%20style%3D%22width%3A%20800px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310161i347EB97BD78277A9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22running-flow.gif%22%20alt%3D%22running-flow.gif%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3EReusing%20the%20flow%20in%20other%20Page%20Libraries%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20built%20the%20flow%20as%20demonstrated%20above%2C%20it%20will%20be%20getting%20the%20site%20and%20library%20dynamically%20based%20on%20the%20trigger%20values.%20So%2C%20it%20can%20be%20reused%20in%20more%20libraries%20using%20list%20formatting.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESimply%20add%20the%20column%20formatting%20JSON%20below%20(sample%20edited%20from%20Microsoft%20365%20PnP%20repository)%20to%20a%20dummy%20calculated%20column%20with%20fixed%20text%20in%20other%20pages%20library%20(use%20the%20calculated%20column%2C%20so%20it%20is%20hidden%20from%20forms).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EReplace%20the%20id%20on%20the%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CSTRONG%3EActionParams%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSTRONG%3Eproperty%20with%20your%20Flow%20ID%2C%20and%20by%20clicking%20the%20button%20added%20to%20this%20column%20with%20the%20JSON%20formatter%2C%20the%20same%20flow%20will%20be%20called%20as%20if%20it%20was%20triggered%20from%20the%20Automate%20menu.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%0A%20%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fcolumn-formatting.schema.json%22%2C%0A%20%20%22elmType%22%3A%20%22button%22%2C%0A%20%20%22customRowAction%22%3A%20%7B%0A%20%20%20%20%22action%22%3A%20%22executeFlow%22%2C%0A%20%20%20%20%22actionParams%22%3A%20%22%7B%5C%22id%5C%22%3A%20%5C%22a9dcaeec-61f9-4dd1-9561-679b15bc3e22%5C%22%7D%22%0A%20%20%7D%2C%0A%20%20%22attributes%22%3A%20%7B%0A%20%20%20%20%22class%22%3A%20%22ms-fontColor-themePrimary%20ms-fontColor-themeDarker--hover%22%0A%20%20%7D%2C%0A%20%20%22style%22%3A%20%7B%0A%20%20%20%20%22border%22%3A%20%22none%22%2C%0A%20%20%20%20%22background-color%22%3A%20%22transparent%22%2C%0A%20%20%20%20%22cursor%22%3A%20%22pointer%22%0A%20%20%7D%2C%0A%20%20%22children%22%3A%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22elmType%22%3A%20%22span%22%2C%0A%20%20%20%20%20%20%22attributes%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22iconName%22%3A%20%22ChangeEntitlements%22%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%22style%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22padding-right%22%3A%20%226px%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22elmType%22%3A%20%22span%22%2C%0A%20%20%20%20%20%20%22txtContent%22%3A%20%22Switch%20Layout%22%0A%20%20%20%20%7D%0A%20%20%5D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ETo%20find%20your%20Flow%20id%2C%20just%20check%20the%20URL%20used%20when%20you%20edit%20it%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22flow%20id.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310163i6B615C29059CCDFA%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22flow%20id.PNG%22%20alt%3D%22flow%20id.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYou%20can%20then%20start%20it%20normally%20from%20any%20other%20Site%20Pages%20library%20in%20the%20tenant%2C%20where%20you%20add%20the%20column%20with%20the%20JSON%20formatting%20calling%20the%20flow%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22switch_flow.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310164i531F5F3D92BC2502%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22switch_flow.PNG%22%20alt%3D%22switch_flow.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20run%20the%20flow%20from%20a%20library%20where%20it%20was%20called%20using%20only%20the%20formatter%2C%20the%20values%20will%20be%20parsed%20correctly%20from%20the%20trigger%20and%20the%20flow%20will%20be%20executed%20successfully%2C%20as%20the%20JSON%20format%20button%20sends%20data%20related%20to%20the%20currently%20selected%20file%20and%20we%20run%20the%20rest%20of%20the%20flow%20dynamically%20based%20on%20the%20values%20sent%20by%20the%20trigger.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2747412%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EHow%20to%20remove%20the%20Page%20titles%20or%20switch%20SharePoint%20page%20layouts%20using%20Power%20Automate%20and%20SharePoint%20REST%20API.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22page%20title%20flow.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310144i83D2180C847EAA07%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22page%20title%20flow.png%22%20alt%3D%22page%20title%20flow.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2747412%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHow%20to%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Co-Authors
Version history
Last update:
‎Sep 16 2021 01:32 AM
Updated by: