Process Guide: Bulk Document Upload to Salesforce via Data Loader

Modified on Thu, 6 Nov at 5:36 PM

1. Purpose & Scope

This document outlines the standard procedure for bulk-uploading documents (specifically PDFs) to the "Documents" tab within a Salesforce org using Data Loader.

This process is designed for efficiency with large batches of files (approximately 50 or more) for Fund Documents, Fundraising and Client Wide Documents, it does not cover Commitment documents or Fund Communication Documents. For a small number of files, manual uploading through the Salesforce interface is recommended.

The procedure is a two-phase operation:

  1. Phase 1: Creating "Document" records in Salesforce, which act as containers.

  2. Phase 2: Uploading the actual files as "Attachments" and linking them to the Document records created in Phase 1.

2. Pre-Upload Requirements & Considerations

Before starting, please verify the following:

  • File Access: All source PDF files must be located in a single, accessible folder on a local or network drive.

  • Data Loader: You must have Salesforce Data Loader installed and the necessary user credentials with API access to the target org.

  • File Naming:

    • Filenames must not contain invalid characters (e.g., *, ?, /, \).

    • The display name (Name) is limited to 80 characters.

    • The full file path (FullName) is limited to 255 characters. This includes the drive letter, all folders, and the filename itself (e.g., C:\Users\Admin\Documents\Uploads\My_File.pdf).

  • File Format: This specific guide is written for PDF files only. The ContentType value in Step 2 will need to be changed if other file types are used.

  • File Size: Document files must be 5mb or less. For larger files up to 40mb, use the Document Uploader - Portal tool to properly upload and split the file.

  • Salesforce Setup: The target folders (Type/Document Subtype/Fundraising Type) must already exist in the Salesforce org before you begin. You will also need the 18-character RecordTypeID for the "Fund Document" Record Type.

3. Step-by-Step Upload Process

This process requires preparing two CSV files, uploading the first, updating the second, and then uploading the second.

Step 1: Populate the 'Documents' Template

First, create a CSV file to generate the master "Document" records in Salesforce.

Column

Field Name

Description

A

Full Name

The full name to be displayed for the document in Salesforce (up to 255 characters)

B

Document Name

A unique name for the document. Can be a duplicate of Column A, but must be 80 characters or less.

C

Portal Document

Always set to TRUE.

D

Document Date

The date to be displayed for the document. (Format: YYYY-MM-DD).

E

Type

Set to associated type,(note that Capital Calls are generally stored in the Financial type. Standard types: General, Fundraising, Legal, Stock Distribution, Tax, Advisory Board, Capital Call, Cash Distribution, Financial.

F

Fundraising Type

Must include if the type is set to Fundraising. The exact name of the destination folder in Salesforce. This folder must exist prior to the upload.

GDocument SubtypeOnly include if needed.

H

RecordTypeID

The 18-character Salesforce ID for the Fund Document, Commitment, or Client Wide Document Record Type in the target org.

I

Fund ID

The 18-character Salesforce ID for the specific Fund record this document relates to.

Step 2: Populate the 'Attachments' Template

Next, create a second CSV file to prepare the actual files for upload.

Column

Field Name

Description

A

Document ID

Must be an exact copy of Status column from the 'Documents' template upload. This is the key for linking the file to its record. You will populate this after Step 3.

B

ContentType

For PDFs, this is always application/pdf.

C

Path

Formula; The full file path to the source file on your computer. (e.g., C:\My Documents\Uploads\FundA_Report.pdf).

DLengthFormula to verify that path lengths are under 255 characters
EFile NameMust match the file name exactly.
FFolderMust match the path in your system exactly. Consider using a different folder if the folder path is long.


Step 3: Insert 'Document' Records (Data Loader)

  1. Open Data Loader and log in to the client org.

  2. Click "Insert".

  3. Select the "Document" object. (You may need to check "Show all Salesforce objects").

  4. Browse and select your completed 'Documents' template CSV from Step 1.

  5. For step 2b, set RecordType to look up by Name.

  6. In the mapping dialog, use the mapping file provided (DocumentUpload.sdl)

  7. Run the insert.

  8. When complete, SAVE THE "SUCCESS" FILE. This file is critical as it contains the newly created Salesforce ID for each Document record.

CRITICAL: Save the Success File

The "Success" file generated by Data Loader is not just a confirmation. It contains the new 18-character Salesforce IDs for every record you just created. You cannot proceed to the next step without this file.

Step 4: Update the 'Attachments' Template (VLOOKUP)

  1. Open the 'Attachments' template CSV from Step 2.

  2. Open the "Success" file from Step 3.

  3. You now need to populate COLUMN A - Document ID in your 'Attachments' file.

  4. Use an Excel VLOOKUP function to do this.

    • The VLOOKUP will look at COLUMN E - Document Name in your 'Attachments' file.

    • It will find the matching "Document Name" in the "Success" file.

    • It will return the corresponding ID from the "Success" file and place it in COLUMN A - Document ID.

    • Example Formula: =VLOOKUP(E2, [SuccessFile.csv]!$A:$B, 2, FALSE) (This assumes the Document Name was in Column E and the new ID was in Column B of your success file. Adjust as needed.)

Step 5: Insert 'Attachment' Records (Data Loader)

  1. In Data Loader, click "Insert" again.

  2. Check the "Show all Salesforce objects" box.

  3. Select the "Attachment" object.

  4. Browse and select your updated 'Attachments' template CSV from Step 4 (which now has the Document IDs).

  5. Map your columns using the "File Mapping.sdl" attached to this article.

  6. Run the insert. Data Loader will now read each row, find the file at the specified Path, and upload it to the Salesforce record specified in the ParentId field.

  7. Save the final success and error files for your records.

4. Verification

After both inserts are complete, spot-check 5-10 records in Salesforce.

  1. Navigate to the Fund record.

  2. Go to the Fundraising tab.

  3. Locate one of the uploaded documents.

  4. Confirm the name, date, and folder are correct.

  5. Click the document to ensure the PDF opens correctly.

If you encounter any errors, please refer to the "error" file from Data Loader to troubleshoot.