We created a field of type "Formula" with Formula Return Type "Text" and the Advanced Formula (using the BR function):

'Line1' + BR() + 'Line2' + BR() + 'Line3'

This field was included in Compact Layout and in Page Layout. The field is sometimes (randomly (!)) displayed correctly (3 lines with line breaks, also see first screenshot)


and sometimes as HTML markup (also see second screenshot):


The same happens using the IMAGE function or any other function generating HTML markup.

In case of correct display the HTML source for this snippet is

<p class="slds-text-body--regular  slds-truncate" data-aura-rendered-by="307:719;a">
    <span data-aura-rendered-by="298:719;a">
        Line1<br data-aura-rendered-by="300:719;a">Line2<br data-aura-rendered-by="300:719;a">Line3

In case of incorrect display the HTML source is

<p class="slds-text-body--regular  slds-truncate" data-aura-rendered-by="307:719;a">
    <span data-aura-rendered-by="298:719;a" class="uiOutputText" data-aura-class="uiOutputText">
  • We're using a sandbox with Winter'18 release
  • the same happens in production evironment and
  • both in Lightning Experience and Salesforce classic
  • in all browsers

Is this a known problem? How can this be fixed?

Correct display

Incorrect display

  • Is it the same in all browsers? Oct 5 '17 at 7:26
  • I think the issue is probably indeed the browser that sometimes generates the layout themselves, interpreting it as rich text and otherwise just as text - in which case you see the HTML. A possible workaround (I think) is to define a rich text field and fill it with that data :) Oct 5 '17 at 7:32
  • @KoenCertyn In this case rich text field works, but not in case of referencing other fields (the 'TestN' strings are just to simplify the problem description). Oct 5 '17 at 8:10
  • You can use workflow rules/PB to complete the reference to the other fields to complete the rich text field, no? Oct 5 '17 at 8:22
  • @KoenCertyn Ok, I've to look at this workflow rules/PB functionality, currently I'm not familiar with this. Formula field is just simple to use, so if there is a solution I would prefer using formulas. Oct 5 '17 at 8:42

Was secretly fixed by Salesforce. No more problems.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.