How to Pull Custom Content Types from Hub Using Power Automate REST API

Microsoft 365, SharePoint, Teams

Powered by LUCK™

For years, SharePoint utilized the content type hub as a place where default and custom content types could live. The process of adding a custom content type from the hub to a site was simple. Add the content type to the hub, waiting up to 4 hours and all would be synced to each site across the tenant.

Well…that is no longer. In September 2021, Microsoft changed its content type publishing process which can be found in this Microsoft support article titled: What’s changed in content type publishing.

This article provides a better understanding of how the process used to work with pushing all content types to how it now works with a pull-as-needed approach. I would encourage you to read it for yourself, but here’s a quick jist to help us understand what has happened as simply running the AddAvailableContentType call won’t grab the content types anymore.

How to PULL Content Types In Power Automate

In the past, we could add a custom content type to a document library for example by waiting a few minutes or hours and then running the following REST API call in Power Automate. The content type would sync from the hub to the site and then you could just run a POST to AddAvailableContentType.

Uri: _api/web/lists/GetByTitle(‘Documents’)/ContentTypes/AddAvailableContentType

This won’t work by itself anymore. You have to PULL the content type from the hub and then add it to your library or list as the new publishing process doesn’t push all content types across the tenant as stated in the above Microsoft support article.

The Magic Power Automate Action to PULL Content Types

Ready?… Here it is, you must run the addCopyFromContentTypeHub parameter. Check out the Microsoft documentation for more info. I’ll break it down on how it works. 

Uri: _api/v2.0/[sites/sitename]/ContentTypes/addCopyFromContentTypeHub

Update the sites parameter with your site (/sites/yoursite).

Make sure you update the content type id in the body and watch as this action will pull your content type. Here are the overall actions used. Both pulling from the hub and adding the available content type as has always been the case.

Looking for an expert to help? Contact C5 Insight.

Resources
Interested in how we can improve your customer and employee engagement?
Contact us for a free assessment ►

Powered by LUCK™

Search Posts

Categories

Recent Posts