Last date modified: 2026-May-14

Auto-populate fields with regular expressions

You can use extraction to identify specific data in your contracts and auto-populate fields with the results. Extraction runs a regular expression—either one included with Contracts or a custom regex you create—against documents and populates the fields you select based on the regex results.

Contracts can auto-populate the following field types. How the field is populated depends on the field type group:

Group 1 field types — Contracts populates these fields with the first-found result of the regular expression.

  • Fixed-length text
  • Long text
  • Whole number
  • Decimal
  • Date

Group 2 field types — Contracts populates these fields based on your result-to-choice mapping.

  • Yes/No
  • Single choice
  • Multiple choice

Auto-populate Group 1 field types

For Group 1 field types, Contracts auto-populates the selected field with the first-found result of the regular expression. Group 1 field types include fixed-length text, long text, whole number, decimal, and date.

  1. Navigate to the Contracts Models tab.
  2. Click New Contracts Model.
  3. Enter a name for the model.
  4. For Model Type, select Regular Expression.
  5. Add a description.
  6. On the Regular Expression card, select your regular expression.
  7. On the Action card, select Populate Existing Field.
  8. On the Populate Existing Field card, select the fixed-length text, long text, whole number, decimal, or date field.
  9. For field to store results, you can store all values found on a document as a delimited list in a long text field.
  10. For Field to store section text, select a long text field to store the text of the section (if segmented) in which the result is found.
  11. For Existing value options,choose how Contracts handles a field that already contains a value:
    • Prepend—Places the new result before the existing text.
    • Append—Places the new result after the existing text.
    • Replace—Replaces the existing text with the new result.
    • Do nothing—Leaves the existing text unchanged.
    • For date fields, you can only select Replace or Do nothing.
  12. Click Save.

Run a regular expression model

After you create your model, run it through an analysis set.

To run the model:

  1. Navigate to the Contracts Analysis Profiles tab.
  2. Click New Contracts Analysis Profile.
  3. Enter a name for the analysis profile.

  4. Add a description.
  5. On the Extraction tab, add the model you created.
  6. Click Save.
  7. Navigate to the Contracts Analysis Sets tab.
  8. Click New Contracts Analysis Set.
  9. Enter a name for the analysis set.

  10. For Analysis Profile, select the profile you created.

  11. Select a saved search to run the analysis on.
  12. Click Analyze.

The analysis status appears under the Status section. After the analysis completes, click Refresh to view results.

Auto-populate Group 2 field types

To auto-populate yes/no, single choice, and multiple choice field types:

For these field types, Contracts will auto-populate the field you choose based on your result-to-choice mapping.

  1. Go to the Contracts Models tab.
  2. Click New Contracts Model.
  3. Name your model.
  4. For Model Type, select Regular Expression.
  5. Add a description.
  6. On the Regular Expression card, select your regular expression.
    An image of the Select Regular Expression window.
  7. On the Action card, select Populate Existing Field.
  8. Select a Field to auto-populate. Choose a yes/no, single choice, or multiple choice field.
  9. Select a Field to store section text. Choose a long text field to store the text of the section, if segmented, in which the auto-populating result is found.
    If the document does not have sections, there are some advanced options for storing text around your regex result.
    An image of the Store Additional Text Around Result section.
    • You can tell Contracts to leave the field blank if there is no section.
    • You can tell Contracts to default to a certain number of words before or after the result if there is no section.
    • Even if the document does have sections, you can tell Contracts to ignore them and only look for a certain number of words before/after the result.
  10. For existing value options, if there is already a value in the field you are auto populating, you can control whether Contracts to replaces the existing value or does nothing and leaves the existing value. For multiple choice fields, you can choose to append onto existing choice values.
  11. Click Save.
  12. On the Result To Choice Mapping card, click Map Results To Choices.

Map results to choices

After saving the Group 2 model, map the regular expression results to specific field choices. This is a 3-step process.

Step 1: Select a saved search

  1. On the Result To Choice Mapping card, click Map Results To Choices.
  2. Select a saved search. Contracts runs the regular expression against the first 1,000 documents in the saved search to generate results.
    Note: To change the document limit, navigate to the Instance Settings tab, filter for the RegexResultsDocLimit instance setting, and update the value.
  3. Click Next.

Step 2: Map results to choices

  1. Review the results table. Each row represents a result found by the regular expression.
  2. Select the checkbox next to one or more results.
  3. From the Choices to auto-populate drop-down, select the choice to associate with the selected results.
    For example, if the regular expression finds "epidemics" in a Force Majeure clause, you can map that result to a Has epidemics yes/no field by selecting Yes from the drop-down.
  4. (Optional) Click Manage to add or remove choices from the drop-down.
  5. (Optional) To clear mappings, click Reset. If specific results are selected, Reset clears mappings only for those rows.
  6. Click Next.

Step 3: Review and save

  1. Review the summary showing how documents will be auto-populated based on your result-to-choice mappings in Step 2.
  2. Review the summary and click Save.

Return to top of the page
Feedback