Print this page

How do I mass move or add documents to a Library in Content?

Knowledge Article Number 000005419
Description

How do I mass move or add documents to a Library in Content?

Resolution

Content is available via the force.com API. Using DataLoader version 17 or later, files may be added into Libraries. This is only available using DataLoader version 17.0 or above.  The Data Loader version can be found in the window title when you open Data Loader.  

The latest version can be downloaded by navigating to:

Non- Enhanced Setup Menus - Setup | Administration Setup | Data Management | Data Loader

Enhanced Setup Menus - Setup | Administer| Data Management | Data Loader


To add a document to a Library:

1)      Find the Id of the Library you want to add the documents to. In your browser, navigate to the Library detail page. The URL will look similar to:

https://cs3.salesforce.com/sfc/#workspaceView?selectedWorkspaceId=058700000004Cd0

The Workspace ID is the 15 characters after the "=" sign (See the red characters above as an example)

2)      Create a CSV with the following fields

a.       ContentDocumentId

b.      ContentWorkspaceId (updated with the new WorkspaceId)

3)      Insert to the ContentWorkspaceDoc object - you will need to check the box Show all Salesforce objects:

Note in API 28 and above versions of the DataLoader this will be Library Document (ContentWorkspaceDoc)

a.       Start Data Loader

b.      Choose insert

c.       Click Show all Salesforce Objects

d.      Select ContentWorkspaceDoc

e.       Click Browse and select the csv file created in step 2, then click Next

f.       Click Create or Edit Map, then AutoMatch fields to columns

g.      Click Ok, Next, Finish
 

NOTE: This process does not remove the Document(s) from the Library it was copied from.

The above article is only relevant for documents with ContentDocument record (For example, files added via Chatter, Files, and Content).

If end users are trying to move files from "Document" tab to library, end users should do the following: 

1. Run Data Export (make sure to include images, documents, and attachments) 
2. From export, review Document.csv and Documents folder for files. 
3. Import files to library using Data Loader. See “Upload Content with the Data Loader”.





promote demote