SOLVED

Unable to change Folder Content Type to Document Set or Vise Versa

Copper Contributor

Hoping I can get some assistance.
Issue: I have a SharePoint library that uses document sets. This library is sync'd to a few staff members local computers so they can manage files. Staff have been creating new folders in the local explorer. This is fine, however they folders are created as the content type "Folder" instead of the document set content type. We used to be able to go into the SharePoint library on the browser and change the content type from folder from the information pane, now we can only do it using rest api. Does anyone know when this feature will be available or if there is a setting I need to turn on to make it work?2024-07-10_12-56-01.jpg

3 Replies
best response confirmed by Bron_Brookes (Copper Contributor)
Solution
The feature to change the content type of a folder to a document set directly from the SharePoint library's information pane used to be available, but it seems to have been altered or removed in recent updates. As of now, the ability to change the content type in this manner is not available, and using the REST API is the workaround.

Here are a few steps to manage this situation and alternatives:

Using REST API
REST API Method: You can use SharePoint REST API to change the content type of a folder to a document set. Here's a basic outline of how you might do this:

Use GetFolderByServerRelativeUrl to get the folder.
Update the folder's content type using the Update method
POST /_api/web/GetFolderByServerRelativeUrl('/sites/yoursite/Shared Documents/yourfolder')/ListItemAllFields
{
"__metadata": { "type": "SP.Data.YourLibraryNameItem" },
"ContentTypeId": "0x0120D520A8D97A4A8D9A43C6DAEC0AFC54" // Example Document Set content type ID
}

Alternative Methods
Library Settings and Policies:

Check if there are any site collection features or library settings that might be affecting content type management. Ensure that content type management is enabled for the library.
Go to the library settings, and under “Advanced settings”, ensure that “Allow management of content types” is set to “Yes”.
Power Automate (Flow):

Create a Power Automate flow that triggers when a new folder is created and then changes the content type to a document set. This approach can automate the process and remove manual intervention.
Example steps:
Trigger: When a new item is created in the library.
Action: Update item properties, including changing the content type.
yeah we have that in place. Client is just not happy with that as an answer. Was hoping that maybe it had been patched. Does anyone know why it was removed or whether it is something they plan to bring back?
1 best response

Accepted Solutions
best response confirmed by Bron_Brookes (Copper Contributor)
Solution
The feature to change the content type of a folder to a document set directly from the SharePoint library's information pane used to be available, but it seems to have been altered or removed in recent updates. As of now, the ability to change the content type in this manner is not available, and using the REST API is the workaround.

Here are a few steps to manage this situation and alternatives:

Using REST API
REST API Method: You can use SharePoint REST API to change the content type of a folder to a document set. Here's a basic outline of how you might do this:

Use GetFolderByServerRelativeUrl to get the folder.
Update the folder's content type using the Update method
POST /_api/web/GetFolderByServerRelativeUrl('/sites/yoursite/Shared Documents/yourfolder')/ListItemAllFields
{
"__metadata": { "type": "SP.Data.YourLibraryNameItem" },
"ContentTypeId": "0x0120D520A8D97A4A8D9A43C6DAEC0AFC54" // Example Document Set content type ID
}

Alternative Methods
Library Settings and Policies:

Check if there are any site collection features or library settings that might be affecting content type management. Ensure that content type management is enabled for the library.
Go to the library settings, and under “Advanced settings”, ensure that “Allow management of content types” is set to “Yes”.
Power Automate (Flow):

Create a Power Automate flow that triggers when a new folder is created and then changes the content type to a document set. This approach can automate the process and remove manual intervention.
Example steps:
Trigger: When a new item is created in the library.
Action: Update item properties, including changing the content type.

View solution in original post