Snippets and Snippet Groups

Snippets and Snippet Groups hold the reusable content that allows you to manage the rich content in your documents. You can organize the Snippets into groups within your documents. Snippets are useful for taking reusable content, and using that content across multiple DocGen Packages.

For example, say you have a business contract that needs different clauses for customers in different regions, and maybe for contract values above a certain financial value. Snippets' can have conditions to support this, to make your Document Generation project flexible and powerful to your organizations needs.

There are some differences between Snippets and Snippet Groups and it is important to understand how each of these terms is defined.

  • Snippet - a reusable piece of content, can be rich text, images, etc. These can have conditions applied to them such as, "Only include if account amount > $500". These conditions can be applied using field tags.

  • Snippet Group - a reusable set of Snippets, often used for numbered or bulleted lists in legal clauses. The Snippet Group editor allows you to move these lists around, such as indenting the lists.

  • Linked Snippet Group - when designing your Document Package, you can use a Snippet Group by linking it to the package. When you link a Snippet Group, you can also add conditions to the Snippet Group using filters e.g. "Only show this snippet group if the account region is Europe".

Enable Snippet Tab in Lightning interface

In some instances, users may not see the Snippets tab appearing in the Lightning Designer interface. In these cases the tab needs to be added. Salesforce provides the following documentation for adding tabs to Lightning interface: Add and Customize Tabs on Lightning Pages Using the Lightning App Builder.

Create and link Snippets and Snippet Groups

Snippets can be linked to a Snippet Group which then can be linked to a DocGen Package. After a Snippet Group is linked you can then add the field tag for the Snippet Group to a template. When you generate documents every Snippet created is added to the output, in the order you specified in the Snippet Group.

You can link multiple Snippet Groups to a single DocGen Package, and you can use the same Snippet Group on multiple DocGen Package. For example, you might have a Snippet Group for a contract and another Snippet Group for a service level agreement. You could link both Snippet Groups to a DocGen Package that generates documents for on boarding new customers. Once a Snippet Group is linked to a Document Package you will be provided with field tags associated with that Snippet Group that you an insert into a document template.

Conditional filtering on Snippets and Snippet Groups

Setting conditional filters on Snippets and Snippet Groups enables you to tailor the documents you create for your customers based on the data in your organization. You can set these filters at the Snippet level, the Snippet Group level, or both levels.

Filtering at the Snippet Group level

Filtering at the Snippet Group level is helpful if you have multiple Snippet Groups connected to a DocGen Package and you want to dynamically add certain groups based on the record used to generate the documents. For example, if new customers with businesses in California get service level agreement (SLA) documents during customer on boarding, you could create a filter to add the Snippet Group that creates the SLA for only customers in California.

Filtering at the Snippet level

Filtering at the Snippet level is helpful if you have different sections of a document for different types of customers. For example, if new customers with businesses in California get service level agreement (SLA) documents during customer on boarding, but customers with businesses in Los Osos, California require an SLA with different requirements than other customers in California. You create a filter to add a Snippet with those requirements to the SLA group for only customers in Los Osos, California.

Using multiple filters

If you add more than one filter, you can add Advanced Filter Conditions. This is filter logic that governs how and when Snippets and Snippet Groups apply to the documents you generate. After adding a filter, the filter is numbered. Your first filter is 1 and your second is 2. You apply advanced filter conditions based on these numbered filters. For example, using the examples above you could further refine these filters with a value of California or CA in the Billing State/Province field.