Docs Made Easy generates documents from the data on a Salesforce record: Word and PDF in Basic, plus PDF forms, PowerPoint and Excel in Pro. Everything you set up hangs off one idea, the document solution, so once you know its parts, every other guide on this site makes sense.

The parts

A document solution is built once by an admin and then used by everyone who clicks its button. It moves through six stages:

#StageWhere you set it upWhat it decides
1Document solution (the button)Document Setup > Launch Quick Start or Launch Wizard > Add DetailsThe Button Name and the Salesforce object the button lives on (the base object)
2Gather DataGather Data pageWhich related records and queries the template can use
3TemplateAdd Template page, with Merge Field HelperThe layout of the document and where each Salesforce value goes
4BehaviorsAssign Behaviors pageFile name, output format, background mode, email and other parameters
5Composer pageOpens when a user clicks the buttonDownload, save to the record or send by email
6Output and deliveryDepends on stages 4 and 5Where the finished file ends up

Document solution. The button and everything behind it. Articles also call it a "solution" or a "solution button". You add the button to the object's page layout under Mobile & Lightning Actions. Each solution has a Solution ID, which Flow and Document Bulk Merge use to run it without a click. See Generate your first document with the Document Automation Wizard.

Gather Data. The base object's own fields are always available. To use data from other records, you add relationships: Add Child for a related list (for example Contacts on Account) and Add Lookup for a record reached through a lookup field (for example Account through AccountId). You can also add SOQL queries here, filtered to the current record with pv0. See Set up object relationships in Gather Data and Choose a data source.

Template. A Word, PowerPoint, Excel or PDF form file that contains merge fields such as {{Account.Name}}. Basic uses Word (.docx) templates; PowerPoint, Excel and PDF form templates need Pro. You don't type the syntax from memory: the Merge Field Helper in the upload window lists the fields for the base object, your relationships and your queries, and copies their syntax for you. See Template syntax basics.

Behaviors. The Assign Behaviors page has a sidebar with Background Mode, Generated File (file name and Convert to PDF?), Email and Other Parameter. An Other Parameter is a name and value pair, such as bgm = 1, that changes how the solution runs. Some settings can also go on the button URL, for example &ofn={!Opportunity.Name}. See Parameter types explained.

Composer page. When a user clicks the button, the Composer page (also called the Composer screen) opens with the merged document. Here the user can make last-minute changes to behaviors, templates and the file name. They can tick where to save a copy (Files, Notes & Attachments, Chatter, Documents), click Download (Template) (the arrow next to it offers other formats and Merge and Edit), which also saves to the ticked locations, or click Send Email. The email preview shown right before an email is sent is a separate screen; the directemailpreview parameter skips the Composer page and opens it directly.

Output and delivery. The file is downloaded, saved to the record, emailed, sent for eSignature, or a mix of these. See Where generated documents go.

When to use which

If you need…Use…
A working document in minutes, from a ready-made layoutQuick Start (Account Brief, Client Letter or Sales Proposal)
Your own template and layoutThe Document Automation Wizard
Fields from parent or child recordsRelationships on Gather Data
A filtered or sorted list that matches the current recordA document query with pv0
Computed or combined data that a query can't returnAn Apex data relationship
Several solutions in one place on a record pageA Document Solution Collection (Pro)
Documents created when a record changes, with no clickFlow with the Solution ID (Pro)
One document per record for many recordsDocument Bulk Merge (Pro)

Example: an account summary with its contacts

  1. Solution. In Document Setup, click Launch Wizard, enter Account Summary as the Button Name, select Account and click Create.

  2. Gather Data. Click Add Child, select Contacts and click Save.

  3. Template. Copy the syntax from Merge Field Helper into a Word file. The contacts go in a table row between TableStart and TableEnd, so the row repeats once per contact. Here the last line stands for a two-column Word table row:

    Account: {{Account.Name}}
    Created: {{Account.CreatedDate \@ "MMMM d, yyyy"}}
    
    | {{TableStart:Account.r.Contacts}}{{FirstName}} | {{LastName}}{{TableEnd:Account.r.Contacts}} |
    
  4. Behaviors. In Generated File, set Filename to {!Account.Name} - {{TODAY}} and turn on Convert to PDF?. Under Background Mode, select File (bgm=1).

  5. Button. Click Go to Page Layouts and drag the button into Salesforce Mobile and Lightning Experience Actions.

When a user clicks Account Summary, background mode skips the Composer page, saves a PDF such as "Burlington Textiles Corp of America - …" to the account's Files and downloads it.

Limits and gotchas

  • Two syntaxes. Templates use {{…}}. Parameter values that read a field use {!Object.Field}, as in ofn and redirecttourl. Before version 1.10, templates also used {!…}; both still work. See old vs new syntax.
  • Child data needs a table. A child field outside TableStart/TableEnd doesn't repeat. Two table forms work, and the Merge Field Helper supports both: the related-list form, such as {{TableStart:Account.r.Contacts}}, fetches all related records, and the alias form, such as {{TableStart:ContactsAcc}}, lets you sort, filter and limit the rows. See Table format.
  • Background mode removes choices. With bgm, users don't see the Composer page, so SC and directemailpreview don't apply.
  • IDs belong to one org. Solution, query, template and sign template IDs are Salesforce record IDs, which differ between a sandbox and production.