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

Community site session details

Session Id : +FTc4k85GsAka8gA1+7EmK
Power Automate - General Discussion
Unanswered

How to set a content type as default in SharePoint library without deleting other Content type.

Like (0) ShareShare
ReportReport
Posted on 31 Aug 2023 05:46:35 by

Hi expects,

 

We initially create a new library in share point and added content type to the library. Now we need to make the newly added content type "TempContentType" as default content type, as there is already a another content type of "Document" is created initially on library creation.

Here we got making default content type by deleting others -  https://powerusers.microsoft.com/t5/General-Power-Automate/Set-a-new-default-content-type/m-p/1375031/highlight/true#M82278

 

So we need to make the newly created "TempContentType" as default content type without deleting other content types.

 

Thanks in advance.

 

I have the same question (0)
  • Expiscornovus Profile Picture
    32,846 Most Valuable Professional on 31 Aug 2023 at 10:03:56
    Re: How to set a content type as default in SharePoint library without deleting other Content type.

    Hi @Naveenav,


    I had another look at this and found that it should be possible via a POST request on the RootFolder of the list. So, no need to remove any existing content types, yay! 😁

     

    On that RootFolder you can set the UniqueContentTypeOrder property value. Kudos to Sorin Sandu with this blog to steer me into the right direction, https://tinysharepoint.wordpress.com/2021/02/01/change-content-type-order-using-uniquecontenttypeorder/

     

    Below is an example

     

    URI

     

    _api/web/lists/getbytitle('@{variables('ListName')}')/RootFolder

     

     

    Headers

     

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

     

     

    Body

     

    {
    "__metadata": { "type": "SP.Folder" },
    "UniqueContentTypeOrder": { 
    "__metadata": { "type": "Collection(SP.ContentTypeId)" },
     "results": [
     { "StringValue": "0x0120D52000D7B65730C11A7B4CB3E96056EEC49DCE0079469C975343344EA7EF1D3391006E14"}, 
     { "StringValue": "0x0100753374BDCA807E4888D2017054283F7A00F8313B858F09DB479E4C3142BAC545D0"}
     ]
    }
    }

     

     

    post_rootfolder.png

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 788 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 452 Moderator

#3
developerAJ Profile Picture

developerAJ 302

Last 30 days Overall leaderboard