Loading

Error Saving Salesforce Notes (ContentNote) That Contain HTML Tags or Unescaped Characters

Publiseringsdato: Jul 4, 2026
Beskrivelse

If your Salesforce organization has the enhanced note-taking tool (Notes) enabled via Set Up Notes, users or administrators may encounter the following error when inserting ContentNote records via the Salesforce API:

Note can't be saved because it contains HTML tags or unescaped characters that are not allowed in a Note.

This error occurs when using tools such as Workbench to insert ContentNote records, or when the insert file contains unsupported HTML tags or incorrectly formatted special characters.

Løsning

This error occurs when inserting ContentNote records via the Salesforce API using tools other than Data Loader, or when the file content contains unsupported HTML formatting. Salesforce requires that ContentNote records are inserted using Salesforce Data Loader (minimum version 32 required). Attempting to insert ContentNote records via Workbench will always result in this error, as Workbench is an unsupported tool.
Recommended settings when inserting ContentNote records:

  • Use the most recent version of Salesforce Data Loader available (minimum version 32)
  • Use a batch size of 1 to ensure best success rates and to identify exactly which records caused errors

Choosing a file type for insert:
When following the steps in the Importing Notes to the ContentNote Object Using Data Loader article, you can specify either an .html or .txt file. Using a .txt file is recommended for the best results.
.html file requirements and limitations:

  • Special characters must be replaced in the file, or the error will occur
  • Formatting made via HTML is not preserved on insert — escaped HTML code is inserted as plain text in the Note's body

.txt file requirements and limitations:

  • Include line breaks by inserting the `

` HTML tag; otherwise line breaks are replaced with spaces

  • Do not escape HTML tags in your .txt file — escaped tags will be inserted as plain text
  • The following inline formatting tags are accepted in .txt files:
    • <i> Italic text </i>
    • <strong> Bold text </strong>
    • <u> Underlined text </u>
  • Multiple tags can be combined, but must be closed in the correct sequence. Example of correct nesting: <strong><i><u>Formatted Text</u></i></strong>
  • Save the file as UTF-8 encoding

Note: It is not currently possible to insert Notes via Data Loader with advanced formatting such as unordered lists, ordered lists, or indentations using either .html or .txt files.
If you need to migrate legacy Notes to the enhanced Notes tool, externally preparing the data files before import is required. As an alternative, consider maintaining the legacy Notes & Attachments related list on page layouts so users can continue to view past notes, while adding new notes via the Notes related list going forward.

 

Knowledge-artikkelnummer

000387974

 
Laster
Salesforce Help | Article