logo

NJP

Document generation made simple using Document blocks

Import · Oct 22, 2021 · article

From the navigation menu, Document template blocks navigates you through the steps to create the conditional blocks in a template. A block can have a set of content or paragraphs each associated with its own condition. For example, “Compensation clauses” can be a block encompassing all possible variations of content related to compensation details based on specific conditions. The table mapped to a block decides what variables you can build these conditions on. Only the blocks mapped to the same table as the template can be used.

Creating conditional block content

Once a block has been created, move on to create content corresponding to a condition. The order of the block defines which content will be picked up and shown if there are multiple conditions (and hence content blocks) evaluating to true. There is no limit on how complex the condition can be. The corresponding content can be authored in HTML allowing for rich-text. Variables can also be added by clicking on ‘Fields’ token picker on the right.

For example: Below is a block with content which needs to appear only when the employee is FTE, so the condition is on the Employment type.

image

Similarly, below is content created specific to contractual employees:

image

When you create an HTML template, you will see a new “Add Blocks” action to be able to add conditional content.

image

You can search for blocks by name and description and add to the template

image

image

Any number of blocks can be added within a template. However, conditions get evaluated on run time of a document, and there may be an impact on the loading time if there are too many conditional blocks.

Previewing a template

You can ‘Preview’ the document in the context of a record (from the table mapped, to show the variable values). For example, an Employment verification letter can be viewed for an Employment verification letter request. Clicking on “Preview as PDF” gives the PDF view of the template with the blocks used.

image

image

Using a template in an HR service

A document template can be linked with an HR service for workflows where a document needs to be signed or generated, like when an employee requests an employment verification letter service. The agent can generate, sign, and email the standard letter to the employee.

Find the different methods of associating a document template to an HR service here and here.

Document editing by an agent working on a case

An agent can edit the document using the “Preview” option. This is useful when specific content needs to be added on a case-by-case basis even when using a template with standard text.

The ‘Preview’ opens the document instance in a HTML view and on clicking ‘Edit’ within this preview, the agent can see which blocks were used and delete those blocks if necessary.

Additional content can also be added to this document instance by the agent.

Any changes made by the agent are only applicable to this instance of the document and do not result in any changes to the template itself.

image

image

image

Frequently Asked Questions

Q: Can an agent edit the block content in the editing view?

A: No, an agent can only delete the block completely in the edit mode. If they want to modify the content, they can first copy the text and then open the edit view and paste the content to modify it.

Q: How many conditions can be mapped to a block content?

A: There is no limit on the number of conditions that can be mapped.

Q: When can an agent edit a document during a case workflow?

A: When the case option “Auto initiate doc tasks” is not enabled while linking a document template to an HR service, the preview shows the edit option for the agent working on an HR case of that service. If this case option is enabled, the document is automatically assigned for signature tasks and hence no editing can be done by the agents.

Resources

Product Documentation: Document templates plugin – HR standard (Rome)

Document blocks

Labels:

View original source

https://www.servicenow.com/community/hrsd-blog/document-generation-made-simple-using-document-blocks/ba-p/2280111