Configure an HTML document template
Create or modify the document template with your unique company logo and audience criteria.
Before you begin
Procedure
- Navigate to All > Document Templates > All Document Templates.
- Select New.
- Select HTML Document Template.
-
On the form, fill in the fields.
Table 1. HTML Template form Field Description Name Name of the document template. Table Table associated with the type of template. The table determines the available variables that can be used. Note:Tables appear based on the application scope that is selected.Category Document category in which the template is added. User criteria Audience criteria for this document. For example, you can create a letter intended for only Canadian employees. Note:When defining conditions like case sensitivity or null values, see APIGlideFilter - Scoped, Global.Body Text in the template. To insert variables, place your cursor in the desired location and select the variable. Available variables are listed under Fields. Use the formatting tools in the Body to apply formatting options, such as bold, italic, underline, font styling. The body is a place holder for HTML text and tokenized variables.
Note:- Jelly and CSS Styling are not supported.
- You can also use Document template scripts to dynamically change the text in the HTML body.
Start date Date starting which the HTML document template is valid. Start date helps in maintaining multiple versions of same template. Note:Start date must be before the end date.End date Date until which the HTML document template is valid. End date helps in maintaining multiple versions of same template. By default, if the values in Start date and End date are empty it will imply that the template will always be valid.
If you specify an end date, you must also specify a start date.
Template date format Format in which you want the date to appear when an agent previews the document, generates the attachment, or initiates document tasks for participants. Note:- When signing using a ServiceNow application or the AdobeSign application: If no value is selected in Template date format, the value specified in the template_date_format system property is considered. If both Template date format and template_date_format system property are empty, the value in the Date format field from the agent's user profile is considered.
- When signing using a DocuSign application: The date format selected in Signing settings in the DocuSign application is considered over Template date format in the configured HTML template in a ServiceNow instance.
Template language Language in which you want dynamic tokens to be translated when an agent previews the document, generates the attachment, or initiates document tasks for participants. The Template language field is also used for full template translation. Note:- Template language is a mandatory field. The default language is none.
- Translation feature is available only when language plugins are installed on the instance.
Select variables List of variables that can be used in the body of the template. Variables pull information from the selected table to customize the template. Offsets are supported for date variables. Offsets extend or subtract days, weeks, or months from a date used in a template.
Valid date offset variables are:- + (plus)
- - (minus)
- d (days)
- w (weeks)
- m (months)
Examples:- Offer letter (five days after the stated date): Your offer is valid until ${Date +5d}.
- Benefits for terminated employee (two weeks from termination date): Your benefits end effective ${subject_person.hr_profile.employment_end_date +2w}.
Note:Only variables that you have access appear.Signing type Option to specify the application that is used for signing the document. For example, ServiceNow Sign, DocuSign or AdobeSign. Note:Signing types are available only when the respective integration plugins are installed.Header Header image Image to be displayed in the header. You can add your company logo using this feature. Note:Supported file types are: JPEG, JPEG2000, GIF, PNG, BMP, WMF, TIFF, and JBIG2.Header image position Position where you want the header image to appear : left, right, or center. Header image height Height of the image in the header. Important:- The height and width of the image is scaled proportionally based on the value that you specify.
- Ensure that the height of the image is lesser than the value specified in the Page size field, otherwise, the image is cropped.
Footer Footer image Image to be displayed in the footer. Note:Supported file types are: JPEG, JPEG2000, GIF, PNG, BMP, WMF, TIFF, and JBIG2.Footer image height Height of the image in the footer. Important:- The height and width of the image is scaled proportionally based on the value that you specify.
- Ensure that the height of the image is lesser than the value specified in the Page size field, else, the image is cropped.
Footer image position Position where you want the footer image to appear: left, right, or center. Footer text Text to be displayed in the footer. For example, you can add proprietary and confidential statements. Footer text position Position where you want the footer image to appear: left, right, or center. Vertical alignment Vertical alignment of the footer text with the footer image. Page Page size Size of the page that can be selected from the list such as Letter, A4, or Legal. Custom font Custom font from the PDF Generation Font Families table. Important:Make sure that you use the custom font family in the CSS of the HTML body.Top/Bottom margin Space from the top of the page until the starting of the HTML content or space from the bottom of the page until the ending of the HTML content. Left/Right margin Space from the left of the page until the starting of the HTML content or space from the right of the page until the ending of HTML content. -
Place the mouse in the desired location in the body of the template and select the Insert Date button to insert date variables.
You can use the button multiple times to add different types of dates based on the variables you choose.
-
Select Add blocks.
- To add an existing document block to the template, in Search blocks, type in the name of an existing document block, select the document block, and select Insert.
- To add a new document block to the template, click Create New Block. For more information, see Create document blocks in Document Templates.
-
To automatically generate Table of Contents (TOC) and page numbers in the
document that is generated from an HTML template, perform the following
steps:
- In the Table of Contents field, select the TOC configuration that you want to apply on the HTML template.
- In the Page number field, select the page number configuration that you want to apply on the HTML template.
- Select Insert Table of Contents and insert the Table of Contents macro in the required position in the body of the HTML template.Note:The Table of Contents macro will not be displayed if the TOC configuration is not selected in the Table of Contents field.
-
To translate content in templates using Localization Framework, select Translate.
For more information, see Use Localization Framework for Document Templates.
- To save your document and remain on the HTML Document Template form, click Save.
- To save and return to the All Document Templates list, select Submit.