Mapping Data from the Main Object
Mapping data means adding dynamic content in the template and selecting where the content needs to come from.
Mapping can be done by drag and drop fields from the Data Source tab in the right panel.
The Data Source tab
In the document template editor, select the Data icon at the 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, Fields section is open, which lists all object fields and fields in referenced objects as a tree structure. Field name starting with an arrow is a reference field to another object. Clicking the reference field will display all fields from the referenced object.
Drag and drop fields to template
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.
For example:
Select the Tags icon next to Data, you can see in the Content, the API name of the mapped field: opp.Account.Name
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, opp.Account.Name
The text in placeholder can be edited as long as information in the Content is correct.
Add field to selected text
If the document has already ready-made static content in the template, to add the dynamic content into existing placeholders, instead of dropping the field to document, the text in the template can be selected to create a placeholder. In the Data Source view, select Add to text selection.
If the 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.