Dive into OmniStudio Document Generation Capabilities
Learning Objectives
After completing this unit, you’ll be able to:
- List the capabilities of OmniStudio Document Generation.
- Explain Document Template Designer and data tokens.
- Explain the use of Data Mappers and OmniScripts.
Explore Document Template Designer and Data Tokens
With OmniStudio Document Generation, sales reps like Candace can:
- Create .docx and .pptx document templates with the Document Template Designer tool.
- Use data tokens, conditional logic, and tabulation in the templates.
- Use JSON (JavaScript Object Notation) to extract and map internal and external data.
- Generate documents using various sources and processes.
Now, let’s zoom in and learn more about the capabilities.
Document Template Designer
A document template defines the structure, content, and format of generated documents. Document Template Designer is a tool you use to create document templates in your Salesforce org. Create Microsoft Word or PowerPoint documents that contain formatted text, including tables, paragraphs, columns, and images. And then use these documents as the basis for new templates.
On the Start New Template screen of Document Template Designer, define the template settings and upload the .docx or .pptx file to create document templates.
Data Tokens
Sometimes, Candace needs to build complex documents. For such documents, she can insert data tokens into her templates to perform certain functions. Let’s understand the different token types.
Token Type |
Function |
---|---|
Variable |
Displays the value of a variable that is passed into the document template as a JSON element. |
Repeating content |
Repeats content sections, for example, a list of products. |
Conditional logic |
Checks a Boolean condition to display content when certain conditions are met. The content can be displayed in a tabular format. |
Image |
Inserts dynamic images in generated documents. |
Rich text |
Inserts rich text content in generated documents. |
Hyperlink |
Inserts dynamic URLs in generated documents. |
Data Mapping with JSON
OmniStudio Document Generation includes Data Mappers and OmniScripts. Data Mappers are configurable services for retrieving, transforming, and updating data, and OmniScripts give users a guided path for completing a business process.
Let’s find out how JSON-based document generation data flow and mapping works.
You can populate your documents with data from your Salesforce org or from external databases. So when you create a template, you can associate it with JSON input data from any source. For example, templates can accept input JSON data from a Data Mapper extraction step in an OmniScript or data from an OmniScript that a user fills out directly. On the Start New Template screen of Document Template Designer, the Token Mapping Method setting determines how you populate the template’s tokens. You can use an OmniDataTransform or a custom class. The document generator takes in the document template and JSON data structure to create output documents in the form of PDF or Microsoft Word.
To learn more about the OmniStudio architecture, review the OmniStudio Architecture module.
Client-Side or Server-Side Processing
You can generate documents using the sample client-side and server-side OmniScripts provided.
The OmniScript walks you through each step required to generate a document. For a sample client-side OmniScript, the steps include:
- Enter Object Id
- Pick a template
- Generation Options
- Generate Document
You can also create your own OmniScripts, integration procedures, and apex classes to generate documents, all on the Salesforce Platform. Integration procedures are declarative, server-side processes that execute multiple actions in a single server call. The final output format of the generated document can be .docx, .pptx, or .pdf.
Whether it’s a contract, quote, or opportunity record page, you can trigger the document-generation process straight from the relevant record. You can set up document generation as a backend process as well.
In the next unit, follow along as Candace identifies the typical use cases of document generation and goes through the steps of creating a quote.