Skip to main content
Conga Support

Merging Detail Data in PDF Templates

Conga Composer has the unique ability to use data from a Salesforce Report or SOQL query as detail data (e.g., invoice line items for each invoice). PDF templates, however, have no way to dynamically expand to accommodate an unlimited number of detail rows.  (If you need that flexibility in handling detail data, consider using a Word-, Excel-, PowerPoint-, or HTML Email-based template which support dynamic detail data.)

With PDF templates, you may lay out a fixed number of rows to accommodate detail data by creating fields in the format DatasetName.FieldName, DatasetName.FieldName_1, DatasetName.FieldName_2, and so on.

To merge Salesforce data into a PDF template:

  1. Open the Template Builder window and copy the field to the clipboard.

  2. Decide how many rows of data you want to accommodate in your PDF template.  Because PDF templates cannot dynamically add rows of detail data as Word, Excel, PowerPoint, and HTML Email templates do, you’ll need to build a row of merge fields to accommodate each result/record in your report or query.

  3. Switch to your PDF program and create a merge field for the field you copied to the clipboard in step 1. This field will represent the field from the first row of data in your report/query.

  4. Create another merge field, perhaps on the next line down on your template. This field will represent the field from the second row of data.  The name of the field must be the same as the previous field, except with an “_1” appended to the end to indicate the second row of data.

  5. Repeat the creation of merge fields, each time incrementing the suffix number, e.g. “_2”, then “_3”, and so on.

Consider this data from a Conga Composer View Data workbook. Here, our Contacts report (note the Contacts dataset worksheet) has retrieved three Contacts related to our Account:

The final output, after merging to the template created above, would look like this: