Thanksgiving Week Special – Get 50% OFF on FileTranz
Claim Your OfferDiscover how to generate documents with dynamic Salesforce data using OmniStudio from template design to final UI execution
Documents play an important role in every business across the entire business lifecycle - from generating quotes and proposals to creating the contract, order documents, and compliance reports. As businesses develop and become more complex, organizations often need documents with dynamic data, reusable templates, conditional content, tables, images, and consistent branding. Traditionally, generating highly customized documents from Salesforce often required third-party solutions or significant custom development. With the help of OmniStudio Document Generation, Salesforce provides a native, low-code approach that allows organizations to generate professional, data-driven documents directly from Salesforce. In this blog, we are going to explore, how to implement server-side document generation using Omni Data Transform, using Quote document generation as an example. This blog consists of complete walkthrough - from creating the template using MS Word and extracting the Salesforce data and transforming that data, configuring OmniScript, and generating the final document from Salesforce UI.
Before stepping into OmniStudio Document Generation, ensure the following setup is completed to have the OmniStudio components and permissions in your Salesforce org.
Salesforce org must have the Omnistudio package installed.
OmniStudio Admin: Grants admins and developers the ability to create new OmniScripts, Data Mappers, FlexCards, and Integration Procedures instances. This permission set license also provides calculation runtime access.
OmniStudio User: Grants users permission to execute OmniScripts, Data Mappers, FlexCards, and Integration Procedures. This permission set also provides calculation runtime access.
DocGen Designer: Enables designers to create document templates and generate documents.
DocGen User: Allows end users to generate documents using existing templates.
Before getting into the configuration, it's useful to understand how the different OmniStudio components work together during document generation. The overall workflow consists of the stages mentioned in the diagram below.

The first step of the OmniStudio Document Generation is to create your document in Microsoft Word or a PowerPoint template. The template includes placeholders (tokens) that are replaced with Salesforce data during document generation, along with formatted text, tables of contents, paragraphs, images, etc. For this example, we’ll use a Microsoft Word document as the template. The template can contain static content as well as dynamic placeholders, allowing Salesforce data to be inserted at runtime.
Note: Placeholders should be enclosed in double curly brackets {{tokenName}}. Example: {{QuoteNumber}}. The token names must align with the output produced by the Transform Data Mapper.

Once we designed the Word or PowerPoint document template, the next step is to configure it in Salesforce using Document Template Designer. Below are the steps,
Configure the template details:
Note: In this blog, we'll use the Server-Side document generation mechanism with Omni Data Transform, which is the recommended standard approach for most implementations.

Data Mappers determine how Salesforce data is retrieved and structured for document generation. For this example, we'll configure two Data Mappers:
This ensures that only the relevant Line Items for the specified Quote are extracted. You can also configure Offset, Order By, and AND/OR conditions here for more advanced filtering needs. Refer to this guide if you want to learn more on Data Mappers.

Activate it.

Preview Data Mapper: After creating the mapping fields, use the Preview option to verify that the data is correctly extracted.
The extracted data will appear in the Response screen, showing the JSON output.

The Transform step converts the extracted Salesforce data into tokenized values that match the placeholders in your document template.
Activate it.

Confirm that the Response screen shows the transformed JSON output, with keys matching the tokens in your document template.

The OmniScript acts as the orchestration layer. It receives the current Quote Record ID, passes that ID to the document-generation component, and initiates the server-side document generation process. Lets configure the OmniScript by following the steps below,
Use the Preview option to verify that the %ContextId% value is correctly populated and passed through the OmniScript.

To enable document generation from the Quote record page, you need to add the OmniScript component in the Lightning App Builder.

This completes the end-to-end implementation of server-side OmniStudio Document Generation using Omni Data Transform.

We’ve now walked through the full journey of Server‑side Document Generation with Omni Data Transform starting from template design, configuring Data Mappers, mapping fields, setting up OmniScript, and finally testing it all in the Salesforce UI. This approach isn’t just the “standard” way; it’s the reliable way to make sure your documents are generated consistently and at scale, without hiccups. Think of it as laying a strong foundation for any future enhancements you’ll build on top. And this is just the beginning. In the next blog, we’ll take things a step further by exploring Document Generation with Integration Procedure and Server‑side Token Data, giving you even more flexibility and control in complex scenarios. Turn Salesforce data into dynamic documents with ease!