Loading

How to Import Images into Rich Text Fields Using Salesforce Data Loader

Veröffentlichungsdatum: May 31, 2026
Beschreibung

Salesforce Data Loader can import images into rich text fields on Salesforce records. This article explains the end-to-end process for mass-importing images by first uploading them as Documents, then constructing HTML image references in your import file, and finally upserting the image HTML into the target rich text field.
Prerequisites:

  • Salesforce Data Loader installed and configured
  • The Salesforce IDs (or External IDs) of the target records
  • Images prepared and ready to upload as Salesforce Documents
Lösung

Step 1 — Upload Images as Salesforce Documents
Prepare an import file to upload images into the Salesforce Documents object. See Mass import Documents into Salesforce for instructions.
Tip: Include a column in your Document import file that maps each document to the Salesforce record ID it will eventually be attached to (for example, name this column RecordID). This makes the later steps easier.
Step 2 — Construct the HTML for the Rich Text Field
After importing documents, take the success file from the import and use it to build the HTML code for the rich text field.

  1. Add a new column to the beginning of the success file with the header link.
  2. Populate the link column using one of the following image URL formats:
    1. For externally available images: <img src="https://c.naX.content.force.com/servlet/servlet.ImageServer?id={ImageID}&oid={OrgID}">
    2. For internally available images: <img src="https://c.naX.content.force.com/servlet/servlet.FileDownload?file={ImageID}">
  3. Find and replace naX with your actual Salesforce instance (for example, na45).
  4. Find and replace {OrgID} with your Salesforce Organization ID. See Find your Salesforce Organization ID for help

Step 3 — Populate ImageID Using a Formula

  1. Insert a new column in front of the link column, with a header that matches your rich text field's API name.
  2. Ensure the ID column from the Document import success file is in column C.
  3. Use the following Excel formula to substitute the ImageID placeholder: =SUBSTITUTE(B2,"{ImageID}",C2)
  4. Right-click column A, copy, then paste special as Values. Save the file.

Step 4 — Import Using Data Loader

  1. Open Data Loader and log in.
  2. Select the Upsert function.
  3. Click Show all objects and select the object that contains the rich text field.
  4. Map the record ID column and the rich text field column.
  5. Select the directory where success and error files will be saved.
  6. Click Finish, then OK.

Your rich text fields are now populated with the imported images in Salesforce.

Nummer des Knowledge-Artikels

000383208

 
Laden
Salesforce Help | Article