For template authors: build a spreadsheet, slide deck or filled-in PDF form from Salesforce data, instead of a Word document. This guide covers what each format supports and how to add it to a solution. Expect about 20 minutes for a first template.
Before you begin
- Docs Made Easy Pro. Excel, PowerPoint and PDF form templates and output are Pro features, added in Pro v1.9.0. Basic supports Word (
.docx) templates only, with Word or PDF output (a regular PDF, not a PDF form). On a Basic license, these templates stop with "Excel merge is not allowed in this basic version" (or PDF or PPT) (DME-LIC-002). See Compare editions. - A document solution with the data you need on Gather Data: related objects, or a SOQL query with an alias for Excel. See Choose a data source.
- A real
.xlsx,.pptxor PDF form file, at most 5 MB. Larger template files aren't allowed (DME-DOC-001). An older.xlsor.pptfile, or a renamed file, can't be opened (DME-TPL-000).
How it works
Excel, PowerPoint and PDF form templates are added to a solution the same way as Word templates, on the Add Template page. From v1.25, Upload a document accepts "Word, PowerPoint, Excel or Adobe" files in Pro. Also from v1.25, conditional logic, formatting and calculations work in PowerPoint, PDF form and Excel templates, not only Word. The v1.25 notes call this "Pro syntax", but it's the same syntax in both editions.
Build and edit these files in Excel, PowerPoint or your PDF tool before you upload them. The in-app Template Editor edits Word (.docx) templates only. {{Image:…}} tags work in PowerPoint and Excel templates as well as Word (Image).
| If you need… | Use | Output |
|---|---|---|
| A list or table of records to sort or total in a spreadsheet | Excel template | XLSX |
| A branded slide deck, such as an account review | PowerPoint template | PPTX |
| An official or regulated form whose layout you can't change | PDF form template | PDF Form |
| A contract, quote or letter | Word template, with PDF output if needed | DOCX or PDF |
Build an Excel template
Excel templates show query results with their own syntax. Write each field as:
&=${{QueryAlias.mergeFieldApiName}}
QueryAlias must match the alias of the query, and the field must be one the query selects.
On Gather Data, create a query with an alias, for example
query, filtered to the current record withpv0:SELECT Id, LastName, FirstName, Name FROM Contact WHERE Account.Id = '{pv0}'In Excel, add a header row, then one row of fields under it:
Last Name First Name Full Name &=${{query.LastName}}&=${{query.FirstName}}&=${{query.Name}}Save the file as
.xlsxand upload it on the solution's Add Template page. Addpv0under Assign Behaviors > Other Parameter, as in Choose a data source.Generate from an account. The output has one row per contact of that account.
Full details: Use SOQL query merge fields in Excel templates.
Build a PowerPoint template
- In PowerPoint, add merge fields where the data should appear, using the syntax from the Merge Field Helper. See Template syntax basics.
- For records in a table, use one table per data set. Tables inside other tables aren't supported in PowerPoint and fail with "Tables inside other tables are not supported in PowerPoint templates" (DME-TPL-000). For nested data, use a Word template: nested tables work only in Word (
.docx) templates, from v1.23.1, not in PowerPoint or Excel. See Nested queries in templates. - Save the file as
.pptxand upload it on the solution's Add Template page.
Use a PDF form template
- Start from a PDF form, a PDF with fillable form fields.
- Upload it on the solution's Add Template page. The v1.25 notes call this an "Adobe" file; the Pro v1.9.0 notes call it "PDF Form".
- Generate the document. The output format is PDF Form. To combine Word and PDF form templates into one PDF, use
MergeDocument(see Merge several templates). The feature overview also lists "PDF form editing", to edit form fields and content before final generation.
Verify it worked
- Open a record of the solution's object and generate the document. The merge preview doesn't work for Excel or PowerPoint templates, so check the generated file.
- Open the file in Excel, PowerPoint or a PDF reader. Check that every field shows the record's data, and that table rows repeat once per record.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| "Excel merge is not allowed in this basic version" (or PDF or PPT) | Your license is Basic | Use a Word template, or upgrade. See DME-LIC-002. |
| "Tables inside other tables are not supported in PowerPoint templates" | A nested table in PowerPoint | Use separate tables, or a Word template. See DME-TPL-000. |
| Excel output has no query data | The alias or field name doesn't match the query, or the &=$ prefix is missing | Copy the alias and API names exactly. See SOQL query merge fields in Excel. |
| "Could not open the file…" | An older or renamed file | Save it as a real .xlsx or .pptx. See DME-TPL-000. |
| "Document is too large to process" | The template file is over 5 MB | Compress images to bring it under 5 MB. See DME-DOC-001. |