Forum Discussion

Mark Whitfield's avatar
Mark Whitfield
Copper Contributor
Jun 16, 2020

Button to create new page / open new page menu

I am looking for a way to either open the new page menu at the 'news post' pane, or create a new news post page (or page of a certain template) completely, by the click of a button. This is with a view to helping less technical members of staff create pages to use it as blog functionality. 

 

Is there a URL that can be obtained for a new page that can be assigned to a button for example?

5 Replies

  • wchaplin's avatar
    wchaplin
    Copper Contributor

    Mark Whitfield 

    Hello, I ended up with a similar situation and ended up using power apps with a power flow to create the buttons.

    The first difficulty was the call to create a page from a template is a post request.
    That ruled out a simple redirect.

     

    In powerapps you can create a button with a function like this 

     

     

    Set(flowResponse,'Http->SendanHTTPrequesttoSharePoint'.Run("25"))

    ; Launch(flowResponse.url);

     

    SendanHTTPrequesttoSharepoint is the flow the .Run("25") is the page number of the template i want to use.

    To get the pages number I used chromes debug to watch the network call for (CopyWithConfiguration) that has the page number in the request. 

     

     

    In power automate you can use the SharePint api object to  create the page :

     

    The whole flow looks like this :

     

    The URL is the link back to your new page that powerapps will Launch.

     

    Hope this helps. 

     

    PS: I also believe this is automatable with the sharepoint api to automatically grab the templates you want but this should get you started.

     

    Heres a sample of the result with 2 button to create pages : 

     

  • Vikram_Samal's avatar
    Vikram_Samal
    Steel Contributor

    Mark WhitfieldYou can use something like this, but then it creates with default template.

     

    https://youtenant.sharepoint.com/sites/siteName/_layouts/15/CreateSitePage.aspx?source=%2Fsites%2FsiteName&promotedState=1&Mode=Edit

     

    Thanks,
    Vik
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • Mark Whitfield's avatar
      Mark Whitfield
      Copper Contributor

      Vikram_Samal Hi Vikram, that is along the lines of what I am looking for, however I am trying to do this but to create a new page using a template, rather than the default.

       

      Do you know if this is achievable.

      • Vikram_Samal's avatar
        Vikram_Samal
        Steel Contributor

        Mark WhitfieldI wish i could have anything more as I still looking for some better solution and checking in fiddler if I can find any other details. I will keep you posted on this.

         

        Thanks

        Vik

Resources