The Magic of the TOC Field – (Table of Contents)

Subscribe to Our Blog

Get weekly updates
straight to your inbox

Submit your email address to subscribe.

By submitting this form you confirm that you agree to the storing and processing of your personal data by Conga as described in our Privacy Statement.

What better way to organize your document than with a table of contents (TOC)? Thinking back to the piles of written papers you were assigned to throughout school, you most likely had to include a table of contents to facilitate the outline and flow of your creation. Well, good news for you Composer devotees, you can also use a table of contents in your Conga Composer documents. 

With the TOC field, you can include information that gets populated with part of the merge process and dynamically grows information throughout your document.

Adding a table of contents in Microsoft Word works to display a TOC, but any Composer detail region will be broken for the rest of the document, (TableStarts and TableEnds will display blank regions). In order to make table of contents work, we take the native Word TOC field and add the “@” symbol like so:


When using native Word field types, you’ll need to include the “@” sign at the beginning of the field name. This indicates to Composer that you want a native Word field (from within a text-based merge field) rather than the usual merge field. {{TOC}} would signal Composer to find a field in Salesforce called “TOC” whereas {{@TOC}} lets Composer know we want the native Word TOC field.

Within that Composer-compatible field you can then specify how many levels (indentations) you’d like your table of contents to have. The “\o” picture switch allows you to determine these levels: {{@TOC\o “1-2”}} says that your table of contents will have 2 levels, specified within the quotations.

Once you have created your detail regions, the TOC field should be placed above them on your document, (this is because most table of contents are at the beginning, though you can insert your table of contents wherever you choose). Your TOC field and main headings should be formatted in the same style.

TOC Field - (Table of Contents)

In this screenshot you can see that the TOC field and the Account Name field are both in Heading 1 style, which is a larger, blue font. This tells Composer to make all headings, (the Account Names in this example), in the same style. For the levels following you can also alter their style within the detail region, which populate throughout the document.


TOC Contacts

In this Account Brief you can see that the headings of each detail region – Contacts, Cases, and Opportunities – are all in the same heading style as the TOC field. And the levels below, being the first and last name, case number, and opportunity name, are all in the style as well.


Once merged, your document’s table of contents will look similar to this:


TOC Table of Contents

You can see that there are two levels within the table of contents, the headings are in the correct style and are followed by the second level that is in the matching font and color that we specified as well. While this example is very basic with only 2 levels and two pages, you are able to make your table of contents as dynamic as you wish by adding as many levels as you’d like, (\o “1-7” – keeping in mind that you can have more than 7 levels), and with creative colors and fonts defined in your heading styles. Go play!


Leave a Reply

Your email address will not be published. Required fields are marked *