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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Sync SharePoint master...
Power Automate
Answered

Sync SharePoint master content type gallery with http request on a newly created site

(3) ShareShare
ReportReport
Posted on by 327

I have a flow I've been working on that deploys a SharePoint site, and creates a few lists based on custom content types in the global content type hub. 

I have the following steps to create a list and apply a content type:

ryleybauer_2-1668985914363.png

 

After some experimenting, I have confirmed that the above works, but only with the default content types. i.e. "0x0103" is fine, but my custom "0x0100AC4AE1EDCA551B478B245F71BB69####" content ID does not work, it's a BadGateway or Unauthorized error.

 

I've determined that the content type hub is not auto-publishing to newly created sites. If I send an http request to add one of my new content types to the list, I cannot. But, if I manually add the content type to a list, then remove it from the list and re-attempt the http request, it works. Thus, I've concluded I need to pull in the global content type gallery somehow. 

 

I found this article about the new content type publishing What’s changed in content type publishing - Microsoft Support 
contentType: addCopyFromContentTypeHub - Microsoft Graph v1.0 | Microsoft Learn

 

I've set up the http request and attempted the following URIs, but I'm getting invalid endpoint errors. Does anyone know what I'm doing wrong on this request?

 

_api/site/contentTypes/addCopyFromContentTypeHub

_api/web/contentTypes/addCopyFromContentTypeHub

/contentTypes/addCopyFromContentTypeHub

/contentTypes/addContentTypesFromHub

 

Method inspired by sharepointcass Create a SharePoint list, add/remove content types and updating the default SharePoint list view through REST API in Power Automate – SharePointCass

 

Categories:
I have the same question (0)
  • AngusWalker Profile Picture
    168 on at

    I'm having exactly the same issue.

  • Verified answer
    ryleybauer Profile Picture
    327 on at

    Hi @AngusWalker , sorry I didn't see this. 

    I couldn't get around this issue, but I just changed my approach and it was much better. Check out my blog post on how to export the existing site as a template so you don't have to worry about syncing the content types! 
    Using PowerShell to Clone an Existing SharePoint Site to the "From Your Organization" Menu  | Bauer Automate

  • ArneBerg Profile Picture
    9 on at

    Hi @ryleybauer !

     

    Did you ever find any solution for this?

  • ryleybauer Profile Picture
    327 on at

    No unfortunately I wasn't able to. But, I accomplished my goal of deploying a site with a few lists that had specific content types by creating a site template that had lists using the global content types. 

  • ArneBerg Profile Picture
    9 on at

    Thank you for your answer! Great that you were able to deploy a site with specific lists and content types by creating a site template that utilized the global content types. Could you please tell me more about how you accomplished this? Thank you!

  • Verified answer
    AngusWalker Profile Picture
    168 on at

    I managed to add my content types using a $batch command.
    I think the biggest issue I had was realising I needed to force the v2.1 version of the api. 

    AngusWalker_0-1682096159197.png

     

  • ryleybauer Profile Picture
    327 on at

    I wrote a blog post about how to deploy the templates from an existing site. 
    https://bauerautomate.com/blogs/post/powershell-clone-site
    Once you have the template available, it's a single HTTP request to create the group, apply the template and even join to the hub: 

    ryleybauer_0-1682098799619.png


    I learned that the creation option has the same leading 20 characters for everyone.
    implicit_formula_292aa8a00786498a87a5ca52d9f4214a_ACTUALSITEDESIGNID

    The design ID is included in the powershell output when you generate the template. You can also open a new powershell window


    # Connect to SharePoint Online
     $baseURL = "ryleybauer"
     $adminURL = ' https://' + $baseURL + '-admin.sharepoint.com'
    Connect-SPOService -Url $adminURL

    Get-SPOSiteDesign

  • ryleybauer Profile Picture
    327 on at

    Thanks Angus! That's not even something I thought to try by changing the API version! +1 and solution for you!

  • ArneBerg Profile Picture
    9 on at

    Thanks a lot @ryleybauer !! Really helpful 😊

     

    Do you know if there are any way to include default values set on folders?

  • ryleybauer Profile Picture
    327 on at

    Hi @ArneBerg I don't think you can, but you could add another step for "update file properties only) might work if you're asking about applying standard metadata. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard