Help Center Getting Started Set Up Your First Template

Set Up Your First Document Template in Dochly

Updated June 2026 8 min read Getting Started
This guide walks you through setting up your first document template in Dochly from start to finish — selecting your primary Salesforce object, building the document structure, inserting merge fields, previewing with real data, and publishing for generation. By the end of this guide you will have a working template that generates a document from a real Salesforce record in one click. For deeper coverage of any step, see the full Template Editor guide series.

What you'll build

For your first template, we recommend building a simple sales proposal based on the Opportunity object. It covers all the core concepts — merge fields, dynamic data, a line items table, and a signature block — without being as complex as a contract or invoice. Once you understand the pattern, every other document type follows the same process.

Goal of this exercise

Build, preview, and publish a working proposal template that generates from an Opportunity record — with customer details, deal amount, line items, and a signature block all populated automatically.

Time to complete

30–45 minutes for your first template including testing. Subsequent templates take significantly less time once you're familiar with the editor and merge field syntax.

Before starting, make sure you have at least one Opportunity in your Salesforce org with an Account, a Contact, and at least one Opportunity Product added. You'll use this record for live preview testing in Step 6.


Choose your primary object

Every template is linked to one primary Salesforce object. This determines which fields are directly available as merge fields. For your first template, use Opportunity — it gives you access to the widest range of useful fields out of the box.

Account

Best for relationship-level agreements, welcome letters, account summaries. Use when the document isn't tied to a specific deal.

Contract

Best for renewal agreements and contract amendments tied to Salesforce Contract records. Use when your org actively uses the Contract object.

Contact

Best for HR documents, onboarding letters, and correspondence directed at individual people rather than companies or deals.

Case

Best for case summaries, resolution documents, and compliance records tied to customer support cases.

Custom object

Any custom object in your org. Must be added to Dochly's object access list in Settings before it appears as an option in the template editor.


Step-by-step: building your first template

1

Create a new template

Open the Dochly app from the Salesforce App Launcher. Click the Templates tab, then click New Template.

  • Template name: "My First Proposal" — you can rename it later
  • Primary object: Opportunity
  • Output format: PDF
  • Status: Leave as Draft — you'll set it to Active after testing

Click Save to open the template editor.

2

Add the document structure

In the template editor, add the basic structural sections of your document. For a first proposal template, keep it simple:

  • Header: Your company name and the word "PROPOSAL" — static text for now
  • Recipient section: Where merge fields for customer details will go (next step)
  • Body section: A brief introduction paragraph
  • Pricing section: Where the line items table will go (Step 4)
  • Signature section: Where signature blocks will go (Step 5)

Use the editor toolbar to apply basic formatting — font, font size, bold for headings. Keep it clean for your first template. For branding guidance see Build a branded document template.

3

Insert merge fields

In the recipient section, place your cursor where customer data should appear and use the Merge Fields picker in the toolbar to insert fields. Start with these essential fields for a proposal:

Prepared for: {{Account.Name}}
Contact: {{Contact.FirstName}} {{Contact.LastName}}
Email: {{Contact.Email}}
Proposal Date: {{TODAY | date: "MMMM d, yyyy"}}
Valid Until: {{Opportunity.CloseDate | date: "MMMM d, yyyy"}}
Reference: {{Opportunity.Name}}

Always use the merge field picker — don't type merge fields manually on your first template. The picker ensures the syntax is always correct. For the full merge field reference see Add Salesforce merge fields to a document template.

4

Add a line items table

In the pricing section, insert a table with 4 columns: Description, Quantity, Unit Price, Total. Then wrap the data row in a repeat block so it expands automatically based on how many products are on the Opportunity:

Description | Qty | Unit Price | Total
---------------------|-----|--------------------|------
{{OpportunityLineItem.Name}} | {{OpportunityLineItem.Quantity}} | {{OpportunityLineItem.UnitPrice | currency}} | {{OpportunityLineItem.TotalPrice | currency}}

Total: {{Opportunity.Amount | currency}}

If your Opportunity doesn't have Products set up yet, the table will be empty on preview — that's fine for now. Test the table specifically with an Opportunity that has products added before publishing.

5

Add a signature block

At the bottom of the template, add a simple signature section for both parties. When you connect this template to Dochly's native e-signature, these become interactive digital signing fields:

Accepted by: ________________________ Date: ____________
{{Contact.FirstName}} {{Contact.LastName}}, {{Account.Name}}

Approved by: ________________________ Date: ____________
[Your Company Name]
6

Preview with live data

Click Preview in the template editor toolbar. Select a real Salesforce Opportunity record from the picker — choose one with an Account, Contact, and at least one product. Dochly generates a live preview document showing exactly what the output will look like.

Check these four things in your preview:

Merge fields

All merge fields show real values — no blank spaces, no "{{field}}" raw text, no "null" appearing.

Line items table

The table shows the correct products from the Opportunity, with quantities and prices populated.

Dates formatted

Dates show in readable format (e.g. "June 15, 2026") — not raw Salesforce date strings.

Signature block

Contact name and company appear correctly in the signature section at the bottom.

If anything looks wrong, return to the editor and fix the issue. Preview again until the output is correct. For common issues see Template editor troubleshooting.

7

Publish the template

Once the preview looks correct, save the template and change the status from Draft to Active. Active templates are available for generation across your org.

You can now:

  • Add a Generate Proposal button to the Opportunity page layout for one-click generation
  • Connect the template to a Salesforce Flow for automated generation on stage change
  • Generate manually from the Dochly Templates tab by selecting an Opportunity record
8

Test generation from a real record

With the template Active, generate a real document from a real Opportunity:

  • Open an Opportunity record in Salesforce
  • Click the Generate Document button (if you added it) or use the Dochly panel on the record
  • Select your new template from the list
  • Click Generate
  • The document appears as a Salesforce File in the record's Files section

Download and open the file to verify it looks correct as a PDF. This is your first successfully generated document from Dochly. For a full test checklist, see Test Dochly after installation.



Frequently asked questions

First, open the Salesforce record you used for preview and confirm the field actually has a value. The most common cause of blank merge fields on a first template is simply that the test record doesn't have that field populated. If the record has data but the field is still blank, check the field API name in the template — a typo causes silent failure. See the full troubleshooting guide for more scenarios.
Yes. You can edit any template at any time. For minor changes (typos, formatting), you can edit in place. For significant changes (adding sections, changing legal content), the recommended approach is to duplicate the template, make changes to the copy, test, then set the copy to Active and the original to Inactive. See the guide on editing and updating existing templates.
Confirm that the Opportunity you're previewing from actually has Opportunity Products (line items) added to it. Open the Opportunity in Salesforce and scroll to the Products related list — if it's empty, the table will show no rows. Add at least one product to the Opportunity and preview again.
In Salesforce Setup, go to Object Manager → Opportunity → Page Layouts → [Your Layout] → Buttons. Drag the Dochly Generate Document button into the layout's button section. Save the page layout — users will see the button the next time they view an Opportunity record.

Your first Dochly template is published and generating documents. Next step: Test Dochly after installation in Salesforce — run a complete verification of generation, e-signature, Flow triggers, and user access before rolling out to your wider team.

Dochly
Salesforce AppExchange — UTECH HUB Install Dochly on AppExchange

Rated 5 stars · Native Salesforce app · Free to install