Document Templates Creating And Editing
Document templates allow users to generate documents that automatically insert information from a case — such as the client's name, legal problem code, primary advocate, and so on. Templates have criteria so that only templates relevant to a case are displayed by default; for example, matching the case's problem code and client's language.
Document templates are also available in the user module to insert information from the user record. This page focuses on templates on cases, but new style templates for the user module are created and mapped in the same way. A site must be using a dynamic user profile page that includes the Recommended Documents block to see any available templates.
Administrators create a template and upload it to LegalServer (or upload a fillable PDF), set display criteria, then map fields to markers within the template. Users see templates in the Recommended Documents list and Email Templates lists on a case.
Related: Document Template Mapping Tips
Related videos: Creating a Template video and Mapping Fields video.
In this Article:
- Create a Template
- Upload a Template and Set Display Criteria
- Map Old Style Document Templates
- Map Email Templates
- Map New Style Document Templates
- Editing Templates
- Enabling a Document Completion Process
- Exception Errors
- Known Issues
Create a Template
Templates are RTF (Rich Text Format) files. New style templates also support fillable PDFs. Files saved as Word documents (.doc, .docx) will not work.
RTF files created in Microsoft Word generally work, but Word has a habit of inserting extraneous formatting characters in field markers. Our experience, and that of many site administrators, is that LibreOffice or another word processor avoids this issue.
Field markers in RTF templates are text between square brackets to indicate where information from a case will be inserted into the generated document.
The text between brackets must not contain spaces or special characters like a slash (/).
The marker text does not need to match field names in LegalServer, but it helps at the field mapping stage to be explicit — ClientFirstName or Client_First_Name instead of just "Name".
Here is a simple letter template:
Templates can contain images such as an organization's logo. However a common problem is large (in size, not necessarily dimensions) bitmap (BMP) images. It is not uncommon for a simple and small BMP image to actually be 10MB or more, and cause problems when attempting to upload as a template. We recommend changing BMP images to PNG or JPG format before putting them in a template.
When using Microsoft Word to create RTF templates, we recommend turning off smart quotes to avoid strangely formatted output in generated documents.
Links (like http://www.legalserver.org ) should be entered in plain text in templates to avoid formatting issues in generated documents.
Upload a Template and Set Display Criteria
Upload templates or fillable PDFs to LegalServer on the Documents page (Admin / Documents). Click the Create a New Document link in the Actions or Options menu tab to open the upload form.
Title is optional but should generally be filled in. The title text is displayed in the template lists.
Viewable Offline? is only relevant for documents that may be downloaded as part of an online intake. "Offline" refers to the person not being logged in to LegalServer. This field is editable only if your role has the related permission.
Type is optional.
Folder is required. If a site has more than a few templates, a Templates subfolder and subfolders under that folder may be helpful. Subfolders can be created on the main Admin / Documents page.
File Name is required. Use the "Browse" button to open a file dialog, then find and select the template on your computer.
Revision Date is optional.
Author is an optional text field. It defaults to the person uploading the template.
Template Type is optional, but must be set to one of the available types to create a template. The template type determines the manner of mapping fields and setting whether a process is associated with the template.
- Old Style Document Template - provides a simple interface for mapping fields, but only a limited set of fields on a case can be mapped.
- New Style Document Template - provides a more complex interface for mapping fields, but provides access to more of the data stored on a case.
- During initial upload, or editing a template, displays an additional "Download instead of Begin Process" prompt. This affects the user experience when using the template. At the default of "No", the user will be taken through a series of steps to produce a document based on the template. If set to "Yes", a document will be immediately generated with certain default values.
- If the template is a fillable PDF, and additional field "Flatten PDF" is shown (effective 2024-11-01). If you select "Yes", the PDF files generated from the template will not have editable form fields.
- Email Template - provides an additional "Data Source" prompt. Select "Client" (the other options do not apply to templates in the context of cases).
- XSLT Template - this is an advanced format that is beyond the scope of this topic. XSL stands for EXtensible Stylesheet Language, and is a style sheet language for XML documents. XSLT stands for XSL Transformations.
Old Style versus New Style Templates
Old Style templates support certain features that new style templates do not: mapping list views, the contents of certain notes, and answers to case questions. However, these features are no longer being actively developed and may be removed in the future.
Documents intended to be used as templates with the Publications and Document Selection blocks are always new style templates.
Display Criteria
The upload page contains several multi-select lists that are used to determine if a template should appear in lists on a case. The Recommended Documents and Email Templates lists on cases have default filters, so that they only display relevant templates. The criteria fields are legal problem code, special legal problem code, county, language, program, and office.
You must select at least one legal problem code and one county for a document template to appear in the lists.
For a template that should appear on all cases (for example a Retainer Agreement), select all legal problem codes, all counties, and all programs.
Map Old Style Document Templates
Click the Edit Fields link on the Actions or Options menu of the document profile page to open the edit fields page. On the left side of the page are all the field markers LegalServer recognized in your template. On the right are dropdown options that map a marker to a field or other data.
For each marker on the left, decide if it will be mapped to a field, a list, notes, or an answer to a case question.
- Field - maps to a field, for example, client's full name or legal problem code. The second dropdown is a search and select list of available fields.
- List - maps to a list of information, for example, the Timeslip Log. The second dropdown displays the available lists.
- Notes - maps to available note types, for example, Case Close Notes. The second dropdown displays the available note types.
- Answer to a Case Question - the Case Specific Questions feature this option is related to has been deprecated. This option should not be used.
Map Email Templates
The mapping interface for email templates is similar to Old Style templates, except that you can only map fields. There is no option to select a list, note, or answer to question.
Map New Style Document Templates
The mapping process for new style templates is more complex than old style templates, but provides access to a greater range of fields. Click the Edit Fields link on the Actions or Options menu of the document profile page to start the mapping process.
The process has 4 steps:
- Fields
- Actors
- Map
- Summary
Links to each step appear in the sidebar, and can be used to return to a different step once it has been completed.
Fields
The first step of the mapping process displays a list of markers recognized in the document. Select the markers to be mapped to fields on the left and move them to the right.
Actors
- Case Data - Contains multiple table links. In addition to basic fields like case ID number, date opened, and legal problem code, it also includes special fields such as "Today's Date" and "Today's Date (Formal)". Most templates will need an actor of this type, and often only need a single actor based on this type.
- Person - Contains multiple table links for a person associated with a case; contact information, name variants, demographics, immigration information, etc. Much of the information about the client can be obtained from a Case Data actor without needing to add a "Client" actor. For example, the client's full name is available via Case Data, but some special fields like "All Aliases" are only available from Person.
- Assignment - Information about an assignment such as Assignment Type, Caseworker, Start Date, etc. Some commonly used assignment fields, like Primary Advocate, are available from a Case Data actor, so an Assignment actor may not be needed for a template.
- Organization - Information about an organization linked to a case, for example a court. Most of the fields available on an organization profile are available for an actor of this type.
Add Actors
Sub Actors
For actors based on Case Data, the current types are: Litigation, Case Note, Unit of Service, Matter Outcome v2, Referral Organization, Charge, Referring Organization, and Related Case(s).
Map
Summary
As noted above, the process steps appear in the sidebar, so you can return to any step of the process via those links without needing to continue on the summary page and clicking Edit Fields again on the template.
Editing Templates
To edit an existing template, use the Actions or Options menu links on the document's profile page.
Use the Edit this document link to change the problem codes, counties, and other criteria used to determine if the template will appear as a Recommended Document on cases.
Use the Edit fields link to change any of the mappings from template markers to LegalServer fields.
Use the Download this document link to download the template to your computer to make changes to the template. Upload the revised file to the same document profile (replacing the existing file), to preserve field marker mappings — except those that have been edited or added.
Use the Download document and mapped fields link (new style templates only) if you want to transfer a template from one site to another; for example from a demo site to a live site. Downloads an XML file which must be imported to the other site. Attempts to preserve as many field mappings as possible.
Use the Delete this document link to delete the template.
Enabling a Document Completion Process
For Old and New Style templates, the template creator determines if the user immediately generates a document by clicking a "Download" link, or starts a process by clicking a "Begin Process" or "Start Process" link.
Email Templates
Email Templates do not have an option to download or start a process. The "Download" link displays a page where the subject, body, and date posted (for the case note that is created) can be changed.
Old Style Templates
By default, Old Style Templates display a "Download" link that immediately generates a document. Alternatively, the template can display a "Begin Process" link that displays a form. The form allows a user to see and change information on the case before generating the document.
Template writers enable a process by clicking the "Create Process" link in the Actions or Options menu on the document profile page, then the "Enable Process" link. The "Edit Process" and "Edit Dynamic Form" links then allow controlling the process and changing the form. If a process is enabled, use the "Disable Process" link to change the link users see back to "Download".
New Style Templates
By default, New Style Templates display a "Start Process" link and take users through a multi-step process to review and optionally select and add information that will be inserted into the template. To immediately generate a document from a new style template, change the "Download instead of Begin Process" field on the template to "Yes".
Exception Errors
Mapping problems can cause "exception errors", which usually result in a mostly empty white page that displays something like "A NNIException error occurred while downloading this document. Please file a support request." when you try to generate a document from a template.
If you get such a page, copy the URL in the address bar to your clipboard, then click your browser's back button, and file a ticket from that page (Help menu > Support Request). Paste the URL into the ticket description box, and add the name of the template.
If you need LegalServer support to look at a template, let us know in the ticket a case it is okay for us to use to generate a document from a template; a case that will demonstrate the issue.
Known Issues
- You can't delete an old style template after enabling a process on it. Trying to delete it will result in an error page. The current workaround is to deselect all problem codes, etc. on the template so that it doesn't show up on any cases. (Ref: 60889).
- The Case Information > Date Proceeding Initiated field causes an error when generating a document. (Ref: 72204)
- You can't delete an Email Template that has been used in the communication manager. (Ref: 76920)
- Case Note subactors cause an error when generating a document from a template. (Ref: LS-46590)
- Special Legal Problem Code cannot be mapped. (Ref: LS-42997)
- Mapping Matter/Case ID# from the Case Information > Case section will now work. The previous workaround of mapping from the Ungrouped section no longer works. (Ref: LS-113077)