Modern teamsite - documents being uploaded not being assigned default content type

Iron Contributor

Within one of our modern teamsites we have a document library with custom content types, one of which we have made default for the library.

When uploading certian word files from our share drives these do not get assigned the default content type, but another.

Just to note that these documents where created outside of sharepoint so they would not have the other custom content type attached to them in anyway.

Any ideas?

Cheers

10 Replies

It doesn't work like that. Setting the Default Content type for a library simply means that when clicking the New menu option in the library you will create a document using that content type - without needing to choose it from the dropdown (you might have defined multiple content types for the library. Also this applies to a classic library where you choose New from the ribbon, in a modern library clicking New simply activates the dropdown)

 

Uploading a document will not assign your default content type, it's there for file creation only.

 

https://support.office.com/en-ie/article/add-a-content-type-to-a-list-or-library-917366ae-f7a2-47ad-...

 

@Ian Moran Thanks for the clarification. So apart from scripting is there anyway to assign a default content type to a library when files and uploaded/copied? Cheers

AFAIK, this is not possible OOTB .

An alternative way to upload items with a specific Content Type is to use 3rd party tools. They allow selection of Content Types, assigning default metadata values, retain original modification date of documents, ...

 

Paul | SLIM Applications

Not as far as I know. You *might* be able to do it with a Flow but it's been a while since I looked at Flow capabilities.

Thanks all.

 

So when uploading/copying to a library with multiple content types does SP assign a CT at random each time? or is there some logic. Cheers

Good question, would need to test this

Interesting. In my SharePoint Online environment with multiple document and folder CTs I observe the following behaviour.
- if the default CT (= the first CT) is a document CT then Drag-and-drop will associate that CT with the new document.
- if the default CT is a folder CT (e.g. document set) the document after drag-and-drop is associated with the 1st document CT in the CT list.

 

Ergo, you are able to set a default CT for documents. Simply make sure it is the first "document" CT in the CT list.

@Paul de Jong I have tried your suggestion but with mixed results. Some documents if I upload get the default CT (the 1st one) others get a different one. Also, if I copy a group of documents from another SP site (with no custom CT's) to the library with my custom CT's it does not apply the default CT. Strange indeed.

Hi Damien one way we have worked around this is to have different libraries for different content type uploads and then workflows to copy or move those files to the library you really want them at.  To setup:

  1. Create a new library for each content type and clearly label the library from a business perspective.
  2. Add the content type to the new library.
  3. Delete any other content type from the new library so it is only the preferred content type.
  4. Add a workflow to copy or copy/delete, the later is usually best so no duplication of files especially from a search perspective, from the "dropbox" to the library you really want the files in.
  5. Setup a menu or page that directs users to the dropboxes so they have an easy method of getting the files to the right spots.

Any questions let me know or feel free to reach out to my company that specializes in these things.  https://www.eswcompany.com

@Ian Moran  I beg to differ. Uploading documents to a document library will apply the default content type to the uploaded documents. The default content type is NOT just for the GUI New button.