Now that you've collected the Salesforce data that you need for the Sales Quote document using Query Builder, it's time to build Document Template. With Maven Documents that comes easy as well.
First, you need to create a Document Template record in Salesforce, which connects a Google Docs, Google Sheets, DOCX, or XLSX file, that you plan to use as a template, with the Salesforce data you pulled in the previous step. If you have successfully authorized the Google and Microsoft accounts with Maven Documents, you can create templates using Google Docs and Google Sheets, save them on Google Drive, and then use them for the document. You also have the option to authorize the Microsoft account and grant Microsoft Azure API access to the Maven Documents application, so you can directly upload online or offline DOCX or XLSX files to Salesforce.
As we've mentioned, Document Template links Document Solution to a specific file. That allows you to use queried fields from Query Builder in this file and modify them to the business requirements.
You can have multiple different Document Templates for one Document Solution, and select the needed Template each time you generate a document. In fact, in this tutorial, you are using the same Document Solution for Google Docs, Google Sheets, DOCX, and XLSX Templates.
On Maven Documents, Google and Microsoft documents are a little bit different to work with. We will now show how to create a Document Template for each type, so you can see what we are talking about.
Follow the steps below to create a Document Template record:
In the Maven Documents app, open the Document Templates tab and click New.
The New Document Template window appears on the screen. It has Name, Document Solution, and Template Type fields.
Name Document Template Sales Quote Template and in the Document Solution lookup field, select Sales Quote.
In the Template Type field, you can select the type of your document. It could be one of the following: a Google Doc, Google Sheet, DOCX, or XLSX file. Choose the Google Doc type.
Once the type is defined, notice that 3 additional fields appear in the New Document Template window: Template Document Id, Document Title, and Open Template.
Such fields as Template Document Id and Open Template are only shown on Google Document Templates, As you can't manually put an ID for Microsoft files or preview them on a Document Template record.
The Template Document Id field holds the ID of the file that you are going to connect to the Document Template.
Paste the ID of your Google file into the Template Document Id field. You can find the ID value of your document in the URL of the document. For example, for Google Docs it would look something like this: https://docs.google.com/document/d/**ID**/edit
, but instead of ID, you’ll have your document ID there.
If you want to have a specific name for the generated document you could populate the Document Title field with this name. If you leave this field blank, the generated document will be named after the Document Template.
Note: It is important to remember, that the document title can also contain merge fields like {!Opportunity. Name}. So you can start customizing the document from the very beginning.
As you can see, the value in the Open Template field will appear after you save the template. This field will be populated with the link to the Google Docs that you defined in the Template Document Id field.
Click Save.
This is how you can create the Document Template record using the Google Docs file. Once the record is saved, you can either open the connected document directly in the new browser tab by clicking Document Template in the Open Template field.
Another option is to preview the template right there in Salesforce by clicking on the Template Preview tab.
Now, we will show you how to create a Document Template with a DOCX file connected. While guide you through, we will highlight places, that are different from Google templates.
In the Maven Documents app, open the Document Templates tab and click New.
The New Document Template window appears on the screen. It has Name, Document Solution, and Template Type fields.
Name Document Template Sales Quote Template and in the Document Solution lookup field, select Sales Quote.
In the Template Type field, you can select the type of your document. It could be one of the following: a Google Doc, Google Sheet, DOCX, or XLSX file. Choose the DOCX type.
Once the type is defined, notice that 3 additional fields appear in the New Document Template window: Document Title, PDF Conformance Level, and PDF Version.
You won't be able to define mentioned PDF Conformance level and PDF Version on Google Document Template as this feature is only supported in DOCX templates.
If you want to have a specific name for the generated document you could populate the Document Title field with this name. If you leave this field blank, the generated document will be named after the file you upload to the Document Template.
It is important to remember, that the document title can also contain merge fields like {!Opportunity. Name}. So you can start customizing the document from the very beginning.
In the PDF Conformance level field you can enter the value that stands for the needed level.
These levels set clear rules and standards for PDF files to make sure they are self-contained, work on any device, and are good for long-term storage. These rules cover things like fonts, colors, metadata, transparency, and other parts of creating and storing PDFs. The aim is to ensure that PDFs look the same no matter what system or software is used to open them.
If you leave the field untouched, the PDFA3a level will be applied by default.
The PDF Version field defines the version of the PDF specification to which the PDF Document conforms. In this field, you can put the value that represents the needed version.
If you leave the field untouched, the PDF_1_7 version will be applied by default.
Click Save.
Although the Template Document Id field is not shown on the DOCX Document Template layout, it still holds the corresponding value in the background. The field gets automatically populated once you upload a certain DOCX or XLSX file to your Document Template on Salesforce.
There are two options available here:
- The URL of the file. The field is populated with the URL of the online DOCX or XLSX file after you upload it to the Document Template.
- The ID of the file. The field is populated with the ID of the locally stored DOCX or XLSX file, once you upload it to the Document Template with the desktop version of Word or Excel.
With these steps passed, you will now have the DOCX Document Template record created.
The Template Preview tab on Azure templates won't have the file preview, cause this feature works only for Google Docs and Google Sheets template types.
Next, you are going to style the created document using Template Builder. Use the links below to read the instructions on building your document with Template Builder at hand: