Filevine’s Document Generation tool, or DocGen, automatically generates documents including variables and data from your projects. One or more DocGen templates are attached to custom Doc Generation buttons added throughout your project template sections. Pressing a Doc Generation button will generate a new file containing data from the project, like the client’s name and address.
Filevine DocGen reads unique replacement codes that correspond to custom fields and replaces those codes with data from your project, not unlike a MailMerge. These replacement codes can be typed into Microsoft Word and Excel templates. Alternatively, DocGen can be used to fill PDF forms with fillable fields.
DocGen is the most basic form of document generation in Filevine and is the easiest form to set up. The other two methods are Collections Exports, which is used for generating documents of reports on collections, and Filevine Fusion, which is used to generate a document that combines information from multiple reports.
You can also watch our training video on Document Generation to learn more.
- DocGen Scope
- Type and Placement
- Doc Generation Button
- Word and Excel Templates
- PDF Templates
- Editing DocGen Templates
- Generating a Document
DocGen Scope
Where you place the Doc Generation button dictates what data is available to the template. If the button is placed in a static section, all custom fields from static sections will be available to the template, but only “aggregate” data from collections, like amount totals and averages, or earliest and latest date entries. DocGen from a static section is best suited for simple letters and forms that don’t require data from specific collection items.
If the button is placed inside a collections section, a DocGen button will be included in every item in that collection, and custom fields from each particular collection item will be available to the template. DocGen buttons in collections sections should be used whenever you need a document per collection item, like an individualized medical records request per medical provider.
DocGen buttons cannot bring in a list from entries in a collection section. If ever you require a list of fields from a collection, turn to Collection Exports or Filevine Fusion.
DocGen is available in three different file types: .docx, .xlsx, and .pdf.
Type and Placement
DocGen documents can be generated by pressing a Doc Generation button, which can generate a document based on a single template, or a Doc Generation Multi-Template button, which is able to generate documents from multiple templates. In most cases, Doc Generation Multi-Template should be used. The Doc Generation for single templates should only be used when you are certain you only need to attach one template.
Users can add multiple buttons throughout the project, but in most cases, fewer buttons will mean less clutter and easier use. For easy setup, include a Doc Generation Multi-Template button in every section to cover all of your scopes.
Think of Doc Generation Multi-Template widgets like template “groups:” all documents generated by a template “group” will be made with the same hashtags and sorted into the same folders, according to the widget’s settings.
Doc Generation Button
Adding a Doc Generation or Doc Generation Multi-Template button is the first step in creating a DocGen. Pressing this button in a project will trigger document generation. To add the button, create a widget and select “Doc Generation” or “Doc Generation Multi-Template” from the dropdown menu. Doc Generation buttons are frequently added to a dedicated section called “Forms,” but they can be added to any custom section. Fill out the widget name or prompt.
Auto Hashtags and Folders
Doc Generation buttons can be configured to automatically add hashtags and a folder location to any document they generate. All documents generated by the Doc Generation button appear in the project’s Docs Section, and these options help to organize the files within the Docs Section. All documents generated by a button will share the same auto hashtag and folder settings.
Including an auto hashtag will attach that hashtag to the document. The document can then be searched by any of those hashtags in the Docs Section search, in the Search Project and Search Deeper tools, and in reports.
Adding auto-move to folder requires a project folder template, and will automatically move the document to the correct folder within the Docs Section when it is generated. (If the folder chosen for auto-move does not exist in the project, folders will automatically be created, including the entire folder path.)
The next sections will discuss creating and adding Word and Excel and PDF templates.
Word (.docx) and Excel (.xlsx) Templates
Once all Doc Generation buttons have been adding to a project type, you will then attach templates to each button in the Doc Generation Setup Advanced tool.
Step-by-Step
- Navigate to the Doc Generation Setup section. Click the hamburger menu in the top left corner and select “Advanced” from the dropdown menu. Next, select “Doc Generation Setup” from the lefthand menu and choose the project type, then the project section, then the field, as applicable.
If the list is empty, you will need to add DocGen buttons to your project using the Customs Editor. - Create the .docx or .xlsx file. Open the file you would like to use as a template, or create a new file and add the text that you would like to include in this template. If you are using a Doc Generation Multi-Template, you can create as many of these templates as you would like to add.
- Find replacement codes. Next to the selected button field name in the Doc Generation Setup Advanced tool, you will find a “Field List” button. Click this button to open a page with all the available replacement codes for this template, organized into sections. For a quick way to navigate through the long list of codes, use Ctrl + F to find keywords, like "client," "incident," "provider," etc.
- Insert replacement codes. Find the code from the field list that corresponds to the text you wish to be auto-filled, and insert that code into the .docx or .xlsx file you are using as a template. Make changes to the layout and wording as needed using the codes. Read below for tips on and examples of replacement codes.
- Upload the templates. Once you are satisfied with the document, upload it to Filevine by clicking the “+ Add Template” button under the corresponding Doc Generation button on the Doc Generation Setup page. Once you have added a template, if you are using a Doc Generation Multi-Template, add an additional template by clicking the green plus button. Multiple templates will need to be added one by one.
If the upload fails, Filevine has found a code that it does not recognize. The error message will tell you which codes are unrecognized. If this occurs, double-check the appropriate code(s).
Replacement Codes
Replacement codes are project type-specific codes used to create templates that will work across projects of a given project type. A replacement code in a template will merge a data point from the project in which the Doc Generation button is clicked. Replacement codes can be found by clicking on the “Field List For This Section” in the “Create New Widget Template” window, or by clicking the “Field List” button in the “Doc Generation Setup” Advanced tool.
Non-custom fields have special field codes, which can be found in the field list. For example, a letter address might look like this:
{{clientaddressBlock}}
Dear {{name}},
It has come to the attention of {{orgName}} concerning case {{projectName}} that...
When generated, the document would be auto-filled with the information from that specific project, looking like this:
Patricia Mist
123 Oak Street
Apt. 2
Buffalo, NY 14201
Dear Patricia,
It has come to the attention of Smith, Smith, & Smith Firm concerning case 123456 that...
The replacement codes for custom fields are formatted a little differently, and consist of a “section selector” (made when you make a new project section), a “field selector” (set when you create a new custom field), and, if applicable, a sub-field, each separated by a period, like so:
{{sectionname.fieldname.subfield}}
For example, in a letter to a medical provider, the "Addressed to:" portion of the letter in the template, using replacement codes, might look like this:
{{meds.provider.addressBlock}}
This replacement code will provide the entire formatted address for the provider.
Replacement Codes Special Formatting
When using replacement codes, the text in the generated form will share the formatting of the code. For example, if the code in the template is bolded, the matching text in the generated document will also be bold.
At the bottom of the field codes page, you will find special formatting codes, which allow you to display dates, conditions, and text in specific ways. The field codes page includes the following replacement codes:
Filter | Output |
---|---|
{{ fieldName | dateFormat:yyyy-MM-dd }} | 11/21/18 |
{{ fieldName | dateFormat:MMM dd\, yyyy }} (use \, for comma) | 21-Nov-18 |
{{ fieldName | shortDate }} | 11/21/18 |
{{ fieldName | longDate }} | November 21, 2018 |
{{ fieldName | month }} | 11 |
{{ fieldName | day }} | 21 |
{{ fieldName | year }} | 2018 |
Filter | Example: 111-222-3333 | Output |
---|---|---|
{{ fieldName | left:<# of chars.> }} | {{ fieldName | left:3 }} | 111 |
{{ fieldName | mid:<start char. (count from 0)>,<# of chars.> }} | {{ fieldName | mid:4,3 }} | 222 |
{{ fieldName | right:<# of chars.> }} | {{ fieldName | right:8 }} | 222-3333 |
{{ fieldName | digitsOnly }} | 1.1E+09 | |
{{ fieldName | digitsOnly | mid:3,3 }} | 222 |
Filter | Example: firST laST | Output |
---|---|---|
{{ fieldName | capitalize }} | FIRST LAST | |
{{ fieldName | titlecase }} | First Last | |
{{ fieldName | lowercase }} | first last | |
Example: for text on multiple lines | ||
{{ fieldName | line:<line # (count from 1)> }} | {{ fieldName | line:2 }} | multiple lines |
Filter | Conditions |
---|---|
{{ fieldName | isTrue }} | Yes/No field has "Yes" answer, or text field is not blank, "No", or "False" |
{{ fieldName | isFalse }} | Field is blank or "No" or "False" |
{{ fieldName | equals:word }} | Field is "word" |
{{ fieldName | contains:word }} | Field has "word" in it |
{{ fieldName | startsWith:word }} | Field starts with "word" |
{{ fieldName | endsWith:word }} | Field ends with "word" |
MERGEFIELD Syntax
In .docx and .xlsx templates, you can also use the MERGEFIELD syntax typically reserved for report exports and Filevine Fusion in DocGen. To do so, take the text within the brackets and wrap it in a MERGEFIELD quickpart:
{{meds.provider.address1line1}} → { MERGEFIELD meds.provider.address1line1 }
{{gender}} → { MERGEFIELD gender }
Doing so allows you to utilize the advanced conditional formatting techniques in normal DocGen templates.
PDF Templates
PDF DocGen requires a PDF with fillable fields. Many government agencies provide a fillable version of forms, but you can also create your own using free tools online. Docs+ users can create fillable fields using the PDF Editor.
Step-by-Step
When you have a fillable PDF, move on to the setup process below:
- Navigate to the Doc Generation Setup section. Click the hamburger menu in the top left corner and select “Advanced” from the dropdown menu. Next, select “Doc Generation Setup” from the lefthand menu and choose the project type, then the project section, then the field, as applicable.
If the list is empty, add DocGen buttons to your project using the Customs Editor. - Upload the template. Upload the template to Filevine by clicking the “Upload” button under the corresponding Doc Generation button. Doc Generation allows for up to 250 fields in the .pdf file.
- Insert replacement codes. Once a .pdf file has been uploaded, select the file and click on the cog above it to open the "PDF Field Map" modal, where you can insert DocGen field codes. Begin typing in the editable fields to choose your replacement codes.
You can also view a list of all replacement codes by clicking the "Field List" button in Doc Generation Setup.
Insert one replacement code each into its matching fillable field. PDF codes do not use {{brackets}} as shown in the replacement codes, only the text within those brackets. If you copy and paste the replacement codes from the list into a field, make sure that the brackets are removed. - Save. When you have filled all of the fields with replacement codes, click “Save” in the lower right corner.
If the upload fails, Filevine has found a code that it does not recognize. The error message will tell you which codes are unrecognized. If this occurs, double-check the appropriate code(s). Each fillable field should contain only one replacement code, without any additional text like commas or periods.
Special Replacement Codes
Replacement codes for PDFs in DocGen are slightly different from those used in a DocGen for a Word or Excel document, and from those shown in the field list page. For PDFs replacement codes, {{brackets}} are not required. Only the text inside the codes are used for .pdf doc gen.
Some replacement codes are not searchable through the dropdown search menus, but they are present on the field codes page, and they work the same way. These include the following:
- projectNumber is used for any field that has been given the Case Number field type, commonly used for Case Number, File Number, etc. If you're unable to search for "File number" or "Case number", etc, that is why.
- incidentDate is used for any field that has been given the Incident Date field type, which is most commonly what the Date of Accident, Accident Date, Date of Incident, etc fields may use. If you're unable to find any of those iterations, that is why.
- TODAY and TODAY_LONG aren't searchable but still work.
- Formatting codes, like | long date, will work in DocGen replacement codes.
Editing DocGen Templates
Renaming
Single and multi DocGen templates can be renamed in the Doc Generation Setup Advanced tool or wherever the DocGen button is placed in the project.
Navigate to the Doc Generation Setup tool in the Advanced menu. Select the proper type, section, and field as needed, and then select the template you would like to rename. Once a template has been selected, you will see options in the top right corner.
Click on the pencil icon to open the “Rename Document” window. Edit the name as you like, and click “Rename.”
You can also rename DocGen templates from the DocGen button by clicking the caret to the right of a generated DocGen and selecting “Properties.” In the opened “Doc Details” window, select “Rename” in the top right. Edit the document name and click the checkmark to save.
Updating and Replacing
Single DocGens can be updated or replaced in the Doc Generation Setup Advanced tool or wherever that DocGen button is placed in the project.
Navigate to the Doc Generation Setup tool in the Advanced menu. Select the proper type, section, and field as needed, and then select the template you would like to update or replace. Once a template has been selected, you will see options in the top right corner.
Click on the replace icon at the far right to upload another template from your computer.
You can also replace DocGen templates from the DocGen button by clicking the caret to the right of a generated DocGen and selecting “Update.” In the opened “Doc Details” window, in the “Version” tab, click the “Upload New Version” button and choose another file to update or replace the template.
Choosing the same file type will update the template. Choosing a different file type will replace the template.
Generating the Document
Once you’ve added a Doc Generation Button and uploaded a template, you are ready to generate your document. Choose a project and navigate to the section the Doc Generation Button is in. Click the button, and a document will generate.
If you are using a Doc Generation Multi-Template, you will be able to choose which template you would like to generate from the dropdown.
Click on the template you’d like to generate and this template name will appear after “Current Template.” To generate the document, click the “Generate” button to the right of the template name.
Once a template has been generated, it will appear in a list underneath the “Choose a Template” search box. Click on the caret next to the document to move, download, hashtag, and more, just as you would with a document in the Docs Section. Click on the “Refresh” icon to regenerate the document again. The most recently generated document will always appear above this list after “Current Template.”
Editable Fields
When a document is generated, any fillable fields on the document remain editable, allowing other users or recipients of the document to edit these fields.
If you would like to ensure that recipients of the document cannot edit these fields, flatten the document by printing from your web browser and saving the document as a PDF before sending it.
Comments
0 comments
Article is closed for comments.