For the complete documentation index, see llms.txt. This page is also available as Markdown.

How To: Work with Rich Text Fields

Preserve or strip formatting when working with rich text fields.

Use the right output mode when rich text fields contain formatting you either need to keep or remove.

Problem

You have rich text fields with HTML formatting that need to be displayed or stripped in your documents.

Solution 1: Preserve Formatting

Use triple braces:

{{{!Opportunity.Description__c}}}

This preserves:

  • Bold, italic, and underline

  • Font colors and sizes

  • Bullet and numbered lists

  • Hyperlinks

  • Tables

  • Images in PDF and DOCX

Solution 2: Strip Formatting

For merge fields:

For related lists:

Input: <p>This is <b>bold</b> text with <a href="#">links</a></p> Output: This is bold text with links

Comparison

Method
HTML Tags
Formatting
Images
Best for

{{{!Field}}}

Rendered

Preserved

PDF and DOCX

Standalone rich text output

strip-html="true"

Removed

Lost

No

Plain text output

type="rtf"

Rendered

Preserved

PDF and DOCX

Rich text inside tables

type="text"

Removed

Lost

No

Plain text inside tables

Tips

  • Use triple braces for standalone rich text fields.

  • Use type="rtf" inside table columns.

  • Strip HTML when you need plain text only.

  • Test images and formatting in the output format you support.

Last updated

Was this helpful?