Loading

Extra line breaks are added to the rich text fields of Knowledge object when importing CSV by Dataloader v60 or higher

Publiseringsdato: Sep 24, 2026
Beskrivelse

Extra line breaks are added to the rich text fields of Knowledge object when importing CSV by Dataloader v60 or higher.

 

In Dataloader v59, LF is converted to blank space. This behavior change leads to add the extra line breaks to the rich text fields because of the following reasons:

 

1) New Lightning Article Editor add spaces between <p> tag when adding line breaks in rich text field.

UI:

Lightning Article Editor add spaces

Data:

----

<p>test1</p> <p>test2</p> <p>test3</p>

----

 

2) When exporting this data by Dataloader (version is not related), spaces (20) are converted to LF (0A).

 

"<p>test1</p>

<p>test2</p>

<p>test3</p>"

 

3) And when importing this data by Dataloader v60 or higher, LF is converted to <BR> tag which leads to extra line breaks.

UI:

Lightning Article Editor add spaces

Data:

----

<p>test1</p><br><p>test2</p><br><p>test3</p>

----

Løsning

This article answers the question: why does importing CSV data into rich text fields on the Knowledge object with Data Loader v60 or higher add extra line breaks, and how do I stop it? Data Loader includes a config property, sfdc.load.preserveWhitespaceInRichText, that controls this behavior.

Why This Happens

Data Loader contains a config property sfdc.load.preserveWhitespaceInRichText that causes line breaks to be converted into `<BR>` tags.

How to Fix It

"sfdc.load.preserveWhitespaceInRichText" is a read-only property that's set to true by default. If you set it to false in the config.properties file (making sure Data Loader is not running when you modify the file), you'll get the intended behavior.

You upload two kinds of text into an RTF field, and the setting you need depends on which one applies:

  1. Text containing HTML formatting — in this case, you explicitly want to control formatting. Setting "sfdc.load.preserveWhitespaceInRichText=false" supports this case.
  2. Text with tabs, line breaks, and similar whitespace — in this case, you haven't explicitly specified formatting but want to preserve whitespace. Setting "sfdc.load.preserveWhitespaceInRichText=true" supports this case. It is the default setting.
Knowledge-artikkelnummer

004633920

 
Laster
Salesforce Help | Article