The easiest way to enable document automation is mapping Salesforce fields into your document template. Mapping can be done by drag and drop fields from Data Source tab in the right panel.
In the document template workspace, select the Data icon at right-side panel to open Data Source. Select the Salesforce sub-tab
Salesforce tab displays Salesforce objects can be mapped into templates, including the Main Object and additional objects which are added in the Flow Setting.
When clicking to the Object name, you automatically open the Fields option, which lists all object fields and fields in referenced objects as a tree structure. Field name starting with arrow is a reference field to another object. Clicking the reference field to display all fields from the referenced object.
Select the fields you want to map in the template.
In the Add new content element, select the drop to document button then drag and drop it to the right position in the template.
A new span with the dynamic content will be created in the template as a child element of the element at the drop location.
Select the Tags icon next to Data, you can see in the Content, the API name of the mapped field:
The text <Account Name> is only a placeholder in the template. When end-users generate the documents, the placeholder will be replaced with data from the field specified in the Content, in this example,
You can edit the text in placeholder as long as information in the Content is correct.
Quite often you have ready-made static content in the template, and want to add the dynamic content into existing placeholders
Instead of drop field to document, you can select the text in the template to be a placeholder. In the Data Source view, select Add to text selection.
If text selection already has dynamic content, the button will show: “Invalid selection”.
The Data Source view remain the same even after you have completed the merge. It helps in case you need to map one field in multiple locations in the template, without browsing the data structure again. The most common example is having the Account Name mentioned throughout the document.