DRTE Sections Editor
Published on June 3, 2026 DRTE
Sections Editor: Administrator & Template Editor Guide
Objective: Enable the Template Sections Editor workspace on the Rich Text Button/Document Template object record page, and learn how to define dynamic templates with sections and RichTables.
The Sections Editor lets you turn a static Word document into a dynamic, data-driven Salesforce template. Each section of the document can pull live data from Salesforce through its own SOQL query, and the merged output can be previewed before it is ever sent to a customer. This guide is split into three parts: Part 1 for the Salesforce Administrator (one-time setup), Part 2 for the Template Editor (building templates), and Part 3 for configuring RichTables (dynamic tables of related records).
What you will learn: Page setup (Admin), document ingestion, data architecting with the Query Builder, content mapping, validation, and RichTable configuration.
Quick Overview: Who Does What
| Role | Responsibility | Where |
|---|---|---|
| Administrator | Adds the pscdSectionEditor component to the record page and activates it | Lightning App Builder |
| Template Editor | Uploads DOCX, builds queries, maps fields, configures RichTables, validates | Document Sections Editor tab |
Watch the Demo
Watch a comprehensive user demo (how to use):
https://www.youtube.com/watch?v=AohE41QYNjU
Part 1: Administrator (Setup)
Role: Salesforce Administrator. Time required: about 5 to 10 minutes. This is a one-time configuration that gives your template editors their workspace.
1. Environment Setup
To provide the Template Editor with their workspace, you must configure the Lightning Record Page:
- Access App Builder: Go to the Rich Text Button/Document Template object, open any record, click the gear icon and choose Edit Page to launch Lightning App Builder.
Editing the Rich Text Button/Document Template record page. - Tab Creation: Add a new tab to the layout. Label it "Document Sections Editor" to maintain standard naming conventions. A dedicated tab keeps the editor separate from the standard record details and gives it the full width of the page.
- Component Deployment: Locate the
pscdSectionEditorunder the "Custom - Managed" components section in the left panel. Drag and drop it into the newly created tab.
Adding the pscdSectionEditor component to the new tab.
2. Component Activation
- Visibility: If the editor should only be visible for certain template types, use Component Visibility filters. This is optional, but useful when only some templates are built with sections.
Setting Component Visibility filters. - Save & Desktop Assignment: Save the changes and ensure the page is activated as the Org Default or assigned to the specific App used by your design team. Without activation, editors will not see the new tab.
IMPORTANT: The Category field on the Template record has been repurposed to store the Object API Name of the Master/Base object. The editor uses this value to know which object your queries start from, so the field is strictly reserved for the API Name and must follow standard Salesforce naming conventions:
- Standard Objects: Use the API name (e.g.,
Account). - Custom Objects: Must include the
__csuffix (e.g.,Service_Ticket__c). - Managed Package Objects: Must include the namespace prefix and suffix (e.g.,
NS__Custom_Object__c).
Category field storing the Object API Name.
Setup Checklist: (1) pscdSectionEditor added to a tab, (2) tab labelled "Document Sections Editor", (3) page activated for the right app/profile, (4) Category field set to the correct Object API Name.
Part 2: Template Editor
Role: Document Designer & Logic Architect
Objective: Transform static Word documents/manual sections into dynamic, data-driven Salesforce templates. The typical flow is: upload, define data, place merge fields, then validate.
1. Document Ingestion
Start by converting your existing business assets into the system:
- Upload: Use the Upload DOCX button to bring in a Microsoft Word file. The engine will split the document into editable RichText sections. Headings and structure in the Word file guide how sections are divided.
Uploading a DOCX file. - Commit: You must click the blue Save button in the header after uploading or making any changes to finalize the creation of these sections in Salesforce. Unsaved changes are lost if you leave the page.
Saving to finalize the sections.
2. Data Architecting (The Query Builder)
This step defines what data is "available" to be merged into your document. Each section has its own query, so a section only exposes the fields it needs:
- Initialize: Click the Settings icon on a specific section and select Build Query.
Opening Build Query from section settings. - Object Mapping: Search for and select the Salesforce Object you are reporting on (e.g., Opportunity or Order).
Selecting the object. - Field Selection: Choose all fields needed for this specific section.
Choosing fields for the section. - The
{pv0}Constraint: To ensure the document pulls data from the record you are currently viewing, you must add a WHERE condition:Id equals {pv0}. At generation time,{pv0}is replaced with the ID of the record the document is being created for.
Adding the Id equals {pv0} condition. - Save Logic: Click Save in the modal to inject the SOQL code into the section's configuration.
Saving the query.
The SOQL injected into the section configuration.
Do not skip the filter: A query without Id equals {pv0} will not be tied to the current record, so the merged document may show missing or incorrect data.3. Content Design & Mapping
Now, link the data to your text layout:
- Insert Placeholders: In the Rich Text Editor, place your cursor where the data should appear. Use the Insert Field... dropdown to select the fields you chose in the Query Builder. Each field is inserted as a merge placeholder that is replaced with real data at generation time.
Inserting merge fields. - Styling: Use the toolbar to apply branding, font styles (Sans Serif is default), and paragraph alignment.
Styling toolbar. - Advanced HTML: If you need specific formatting (like custom CSS or table widths), click <Edit HTML> to modify the raw source code. Take care not to alter or delete the merge placeholders.
4. Validation & Quality Control
Always validate before releasing a template for real use:
- Preview: Use the Preview Document button at the top of the page (make sure you have defined the Test SFDC Record Id in the details tab). This is your "Sandbox" mode to verify that
{{Field_Names}}are replaced by actual data values.
Previewing the document. - Logic Check: Verify that dates, currency, and lookup names (e.g.,
Account.Name) are rendering correctly.
Verifying rendered values. - Version Control: Use the Export Sections feature to download a JSON backup of your work before making major structural changes.
Design Tip: If you need to pull data from a related parent object (e.g., the Account Name from an Order), ensure you select the Relationship Fields tab within the SOQL Query Builder during Step 2.
Part 3: Configuring RichTables
Goal: Create dynamic, styled data tables for related lists (e.g., Order Products, Quote Lines). Unlike a normal text section, a RichTable repeats one row for every related record found.
1. Initializing the Table
Instead of a standard paragraph, you can insert a structured data grid:
- Insert Table: In the Section Editor toolbar, click the + button (or use the "Rich Table" menu item to select a Table type).
Inserting a RichTable. - Selection: This creates a dedicated RichTable block within your document section, specifically designed to iterate through multiple records.
2. Data Mapping (Table-Specific SOQL)
Just like paragraph/Rich Text blocks, tables require a data source, but they usually target Child Objects (or any related SFDC Object):
- Build Query: Open the Query Builder within the RichTable settings.
Opening the RichTable Query Builder. - Target Child Records: Select a child object (e.g., Negotiated Rate).
- Relational Filtering: Set the filter so the parent ID matches the current record. Example:
OrderId equals {pv0}.
Filtering child records by the parent ID. - Field Selection: Choose the columns you want to display (e.g., Product Name, Quantity, Unit Price, Total Price).
Choosing display columns.
3. Table UI & Column Configuration
Once the query is saved, the RichTable interface allows for granular UI control:
- Column Mapping: The fields from your SOQL query appear as available columns.
Available columns from the query. - Header Customization: You can manually rename the headers (e.g., changing "Name" to "Role") so the printed table uses business-friendly labels.
Renaming column headers. - Styling & Alignment: Use the columns and table style tab settings to:
- Set Column Widths (fixed or percentage).
- Set Text Alignment (e.g., right-aligning currency values).
- Apply custom borders for better readability.
Table style and alignment settings.
4. Previewing the Table
When you click Preview Document to test, the RichTable will:
- Identify the child records related to the current record, as defined in the SOQL query.
- Dynamically generate the necessary number of rows.
- Apply the styles and headers you defined.
Preview of the generated RichTable.
Editor Tip: If a table has too many columns for a standard Portrait page, use the <Edit HTML> option or the Table Style Tab Properties to set the width to 100%.Frequently Asked Questions & Troubleshooting
Q: I don't see the Document Sections Editor tab.
Confirm the Lightning page was saved and activated for your app/profile, and that Component Visibility filters are not hiding it.
Q: My sections disappeared after uploading a DOCX.
Click the blue Save button after uploading to commit sections to Salesforce.
Q: Preview shows blank or wrong values.
Check that the Test SFDC Record Id is set, the query includesId equals {pv0}, and the Category field holds the correct Object API Name.
Q: My RichTable shows no rows.
Verify the child object filter (e.g.,OrderId equals {pv0}) and that the test record actually has related child records.
Key Takeaways
- Admin adds
pscdSectionEditorto a "Document Sections Editor" tab and activates the page. - Category holds the Object API Name of the base object.
- Always click Save after uploading or editing sections.
- Every query needs
Id equals {pv0}(or the parent ID filter for RichTables). - Preview with a Test SFDC Record Id and export a JSON backup before major changes.
Knowledge Article Number: KA-00225