In Flows or Apex automations, when a Long Text Area field (e.g., Description, Notes) is copied to the Content field of a ContentNote, the resulting note appears as a single unbroken paragraph. Line breaks, paragraph spacing, or new lines present in the original text are not reflected in the note.
The root of this issue lies in the difference between how Long Text Area fields and the ContentNote Content field handle formatting:
When Flow assigns plain text directly to a Rich Text field without converting the line breaks to HTML, those breaks are not rendered visually.
This article explains how to preserve line breaks in ContentNote records created via Flow, using a small Apex utility that converts plain-text line breaks into HTML before assigning the text to the Content field.
To preserve line breaks in ContentNote records, use a small Apex utility that replaces all newline characters with `<br/>` tags before assigning the text to the Content field.
`String formatted = originalText
.replace('\r\n', '<br/>')
.replace('\n', '<br/>')
.replace('\r', '<br/>');`
This code ensures that all common types of newline characters (Windows-style `\r\n`, Unix-style `\n`, and legacy Mac-style `\r`) are converted to HTML line breaks and are rendered correctly in the note content.
This method ensures the original formatting - including paragraphs and line spacing - is preserved accurately in the ContentNote.
004693703

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.