What you'll see
A table of related records (contacts, opportunity products, query results) in the generated document that:
- has its header row but no data rows
- shows only one row when the record has several children
- doesn't repeat at all, or repeats the wrong part of the table
- lists records that belong to other records, not just this one
- is missing completely
- fails with "Tables inside other tables are not supported in PowerPoint templates" (DME-TPL-000)
Most likely causes
TableStartandTableEndaren't in the first and last cells of the same row.- The names in the two tags don't match each other, or don't match the relationship or query.
- A filter or limit on the relationship or query hides rows.
- A document query has no
pv0filter, so it isn't tied to the current record. - The record really has no child records, and the table is set to be deleted.
- The template nests one table inside another in PowerPoint.
How to fix it
The tags aren't in one row
The row between the tags is the part that repeats, once per child record.
- Put
{{TableStart:…}}at the start of the first cell of the row, before the first merge field. - Put
{{TableEnd:…}}at the end of the last cell of the same row, after the last merge field. - Keep the header row outside the tags, so it appears once.
| Product name | Quantity | Price |
|---|---|---|
{{TableStart:Opportunity.r.OpportunityLineItems}}{{Name}} | {{Quantity}} | {{TotalPrice}}{{TableEnd:Opportunity.r.OpportunityLineItems}} |
The names don't match
There are three forms of the table name. All are valid, and the Merge Field Helper supports them:
| Form | Example | Where it comes from |
|---|---|---|
| Related list | {{TableStart:Account.r.Contacts}} | The child relationship. Fetches all related records |
| Alias | {{TableStart:ContactsAcc}} | The alias you give a child on Gather Data. Lets you sort, filter and limit the rows |
| Query | {{TableStart:QueryData1}} | The alias of a document (SOQL) query. An alias is required for a query. Lets you sort, filter and limit the rows |
The related-list and alias forms both fetch the same child records, so you can use either. If a table shows too many rows and you used the related-list form, switch to the alias form and add a filter or limit.
- Check that
TableStartandTableEnduse exactly the same name. - Open Merge Field Helper and copy the table from the Relationship Merge Fields tab (for a child relationship) or the SOQL Query Fields tab (for a query). Paste it over your table row.
- Retype any tag that has mixed formatting inside it. See Merge fields are blank or show as {{…}} text.
A filter or limit hides rows
- Open the solution and go to Gather Data.
- Open the child relationship or the document query.
- Check Limit. A limit of
1returns only one record. - Check the filter conditions. Remove them, generate again, then add them back one at a time.
- Check Order By if the right rows appear in the wrong order.
The query isn't tied to the current record
A document query without a pv0 filter returns every matching record in your org, not just the ones related to the record you generate from.
- In the query, filter on
{pv0}, for exampleSELECT Id, Name FROM Contact WHERE AccountId = {pv0}. Save the query. - In the solution's Assign Behaviors query parameters, give
pv0its value, for example{!Account.Id}.
If pv0 isn't given a value, the record ID is used by default, which works when the filter is on the current record's ID. If pv0 should be something other than the record ID and no value is passed, the query can fail. You can add more parameters the same way: pv1, pv2 and so on.
See Filter a query to the current record (pv0). If Salesforce rejects the query itself, see DME-SF-001.
There are no child records
- Open the record and check the related list in Salesforce.
- Choose what an empty table does: Keep Table shows it with no rows, Delete Table removes it. You can also put
{{TableHide:Account.r.Contacts}}in the table's header row. The TableHide row itself is removed from the output. - To hide a table based on a field on the main record instead, use TableHide:Master.
The template nests tables in PowerPoint
PowerPoint templates don't support a table inside another table. Use separate tables. Nested tables work only in Word (.docx) templates, from version 1.23.1, and not in Excel. See Nested queries.
The table is very long
There's no hard limit on rows, but keep tables and relationship queries to about 500 rows. Above that, generation may slow down. Use a filter or Limit to keep the table smaller.
Who can fix it
- The template author: tag placement and names.
- Your Salesforce administrator: relationships, queries, filters, limits and
pv0in the solution; access to the child records (DME-SF-004). - Docs Made Easy support: a table copied from the Merge Field Helper that still comes out wrong.
Still stuck?
Contact support and send your Org ID (How to share your Org ID), the solution name or ID, the template file, a link to the record and how many child records it has, the time with your time zone, and any error message with its Error code and Reference.