Automate document assembly based on field values

Generating new documents is often a manual part of the workflow following a contract review project. With Document Assembly, you can automate document creation at scale based on the structured data you've extracted during review.

Assembly templates as building blocks

Assembly templates are the building blocks of document assembly models. An assembly template in Contracts is essentially a Word document with enhanced capabilities. When you add tokens to the Word document, you can later map those tokens to fields in Relativity to fill them in with data.

For example, if your Word document has the phrase "Effective as of {{effective_date}}," you can you can later map this {{effective_date}} token to the Effective Date field in Relativity to fill in the actual date of the contract in place of the {{effective_date}} token in the Word document.

If the effective date is March 3rd, 2017 Contracts will generate a new Word document and the new phrase will read "Effective as of March 3rd, 2017."

Note: Tokens cannot contain spaces. In the example, the token must be {{effective_date}}, not {{effective date}}.

There are more advanced functions you can put in the Word document to, for example, implement "if this, then that" functionality based on what data is filled in place of a token. Reach out to support to explore more options.

Contracts supports the following functions:

Function Scope
Date functions All functions supported
Math All functions supported
Strings All functions supported
Regex All functions supported
Code blocks Only single line expression statements supported

Creating an assembly template

To create a new assembly template:

  1. Go to the Contracts Assembly Templates tab.
  2. Click New Contracts Assembly Template.
  3. Name your assembly template.
  4. Add a description.
  5. Select a file to upload from your computer and use as a template.
    This must be a Word document.
  6. Click Save

Running document assembly

To generate a new Word document for every document in your data source based on your assembly template and field-to-token mapping:

  1. Go to the Contracts Models tab.
  2. Click New Contracts Model.
  3. Name your model.
  4. For Model Type, select Document Assembly.
  5. Add a description.
  6. On the Assembly Template card, select the assembly template you created.
  7. On the Output Control Number card, add text you'd like to append to the control number Contracts generates for each newly assembled Word document.
  8. Click Save.

Setting up token mapping:

  1. On the Token Mapping list, click Edit.
  2. On the list of tokens to the right, move over the tokens you'd like to map into the middle area.
    You can do this by dragging, double clicking, clicking once and then clicking the left arrow, or by clicking the Move All button. You can also type to filter for the tokens you want.
  3. On the list of fields to the left, move over the fields that you'd like to map into the middle area.
    You can do this by dragging, double clicking, clicking once and then clicking the right arrow, or by clicking Move All.
    You can type to filter for the fields you want but you can only map fixed-length text, long text, whole number, decimal, date, single choice, and yes/no fields.
  4. Drag to reorder your fields/tokens in the middle area as necessary. Once mapped correctly, click Save.
  5. The modal will close and your mapping should be accurately reflected in the Token Mapping list.
    An image of a completed Token Mapping list.
  6. With the Use Previous Mapping drop-down, you can select an existing document assembly model and Contracts will auto map the fields to tokens for you.

To set up an analysis profile:

  1. Go to the Analysis Profile tab.
  2. Click New Contracts Analysis Profile.
  3. Name your analysis profile.
  4. Add a description.
  5. On the Document Assembly tab, add the model you created.
  6. Click Save.

To create an analysis set::

  1. Go to the Analysis Set tab.
  2. Click New Contracts Analysis Set.
  3. Name your analysis set.
  4. Choose the analysis profile you created.
  5. Select a saved search to run the analysis on.
  6. Click Analyze.

Outputs generated by Contracts

For every document in the saved search of your analysis set, Contracts will generate a new Word document in Relativity.

Control number of the new Word document

The new Word document will have a control number that includes the control number of the original document in the saved search used to generate it.

For example, if you ran your analysis set on a saved search with a document that had the control number "Enphase Lease," the control number of the newly assembled Word document will have the following control number: Enphase Lease_htk_new_[random 3 character ID].

If you choose to append text to this control number, the new control number will be: Enphase Lease_htk_new_[random 3 character ID] [your custom text].

Fields on the new Word document

The new Word Document will inherit all the field values from the original document in the data source used to generate it.

For example, if there are 10 fields with values populated on Document 1, after running document assembly the new Word document will have the same 10 field values, including Contracts Related Documents, so the Word document will appear in the Related Items Pane in the Contracts Viewer.

Supported field types that can be mapped to tokens

You can map the following field types to tokens on an assembly template:

  • Single choice
  • Multiple choice
  • Single object
  • Multiple object
  • Long text
  • Fixed-length text
  • Date
  • Currency
  • Whole Number
  • Decimal

Note: Contracts supports fields that are open to association. Open to Associations is an advanced setting on fields that determines whether an object field can display its information on an associated object field. Fields that are open to association are sometimes referred to as reflected fields.