Document Automation: Merge Fields

Document Automation: Merge Fields

Overview

Merge fields allow you to automatically populate information from Matters.Cloud records into document templates. When a document is generated, the merge fields in the template are replaced with data from the associated record, such as the client, matter, datatable, matter contact, addressee, opportunity, or document author.

For example:

«=client.name»

When the document is generated, this could be replaced with:

Acme Limited

Merge fields can be inserted into Microsoft Word templates uploaded to Matters.Cloud and are available throughout the document, including within headers, footers, tables, and body content.

Using Merge Fields

Merge fields follow the format:

For example:

Dear «=client.first_name»,

When generated, this might become:

Dear John,

Available Merge Fields

The following sections describe the merge fields available for each record type.

Fields: Document

The following merge fields are available for the current document:
Merge FieldDescription
«=document.date»Date when document was first created from a template (short format)
«=document.date_long»
Date when document was first created from a template (long format)
«=document.day»
Day of the document date (e.g. 3)
«=document.day_ordinalize»
Day with ordinal suffix (e.g. 3rd)
«=document.month_number»
Month as a number (e.g. 1)
«=document.month_shortname»
Abbreviated month name (e.g. Jan)
«=document.month_longname»
Full month name (e.g. January)
«=document.year_4digit»
Four-digit year (e.g. 2026)
«=document.year_2digit»
Two-digit year (e.g. 26)
«=document.year_4digit_words»
Four-digit year in words (e.g. two thousand and twenty-six)
«=document.year_2digit_words»
Two-digit year in words (e.g. twenty-six)
«=document.author_name»
Full name of the user who generated the document
«=document.author_email»
Email address of the user who generated the document
«=document.author_job_title»
Job title of the user who generated the document
«=document.author_business_phone»
Phone number of the user who generated the document
«=document.author_department»
Department of the user who generated the document
«=document.author_code»
User code of the author
«=document.author_signature»
 Signature of the author

Fields: Entity

The following merge fields are available for the current entity:
Merge FieldDescription
«=entity.name»Unique identifier of the entity
«=entity.tax_number»
Tax or VAT registration number of the entity
«=entity.domain_name»URL for the entity's website
«=entity.business_phone»Business phone number of the entity
«=entity.email»Email address of the entity
«=entity.address_1»Address line 1 of the primary address for the entity
«=entity.address_2»Address line 2 of the primary address for the entity
«=entity.address_3»Address line 3 of the primary address for the entity
«=entity.address_city»City of of the primary address for the entity
«=entity.address_region»Region/state of the selected address
«=entity.address_country»Country of the selected address
«=entity.address_postcode»Postcode/zip code of the selected address
«=entity.dx_number»
DX Number of the selected address
«=entity.dx_exchange»
DX Exchange of the selected address
«=entity.full_address»
Full address in a single line
«=entity.full_address_block»

Full address arranged in block format

Fields: Addressee

The following merge fields are available for the current address:
Merge FieldDescription
«=addressee.name»Name of the addressee (organization name or full name if contact)
«=addressee.reference»
Reference information for tracking or identification
«=addressee.salutation»How they like to be addressed (optional)
«=addressee.first_name»First name of addressee (contact only)
«=addressee.middle_name»
Middle name of addressee (contact only)
«=addressee.last_name»Last name of addressee (contact only)
«=addressee.email»Email address of the addressee (billing email or email if contact)
«=addressee.job_title»
Job Title of addressee (contact only)
«=addressee.home_phone»
Home phone number of addressee (contact only)
«=addressee.business_phone»
Business phone number of addressee
«=addressee.mobile_phone»
Mobile phone number of addressee (contact only)
«=addressee.address_1»Address line 1 of the selected address
«=addressee.address_2»Address line 2 of the selected address
«=addressee.address_3»Address line 3 of the selected address
«=addressee.address_city»City of the selected address
«=addressee.address_region»Region/state of the selected address
«=addressee.address_country»Country of the selected address
«=addressee.address_postcode»Postcode/zipcode of the selected address
«=addressee.dx_number»
DX Number of the selected address
«=addressee.dx_exchange»
DX Exchange of the selected address
«=addressee.full_address»
Full address in a single line
«=addressee.full_address_block»
Full address arranged in block format
«=addressee.full_address_linear»Full address arranged in linear format

Fields: Client

The following merge fields are available for the current client:
Merge Field
Description
«=client.client_code»
Unique identifier of the client record
«=client.name»Name of the client
«=client.date_of_birth
Client's date of birth (Contact Only)
«=client.salutation»
How the client should be addressed (Contact only)
«=client.first_name»
Client's first name (Contact only)
«=client.middle_name»
Client's middle name (Contact only)
«=client.last_name»
Client's last name (Contact only)
«=client.job_title»
Client's Job Title (Contact only)
«=client.party_type»
Contact or Organization
«=client.payment_days»Client's payment days
«=client.tax_number»
Tax or VAT registration number of the client
«=client.domain_name»URL for the client's website
«=client.business_phone»Business phone number of the client
«=client.business_phone»
Home phone number of the client
«=client.mobile_phone»
Mobile phone number of the client
«=client.email»Email address of the client
«=client.owner_name»
Owner of the client
«=client.address_1»
Address line 1 of the selected address
«=client.address_2»
Address line 2 of the selected address
«=client.address_3»
Address line 3 of the selected address
«=client.address_city»
City of the selected address
«=client.address_region»
Region/state of the selected address
«=client.address_country»
Country of the selected address
«=client.address_postcode»
Postcode/zipcode of the selected address
«=client.dx_number»
DX Number of the selected address
«=client.dx_exchange»
DX Exchange of the selected address
«=client.full_address»
Client's address in a full single line
«=client.full_address_block»
Client's full address formatted as block
«=client.full_address_linear»Client's full address formatted in a line

Fields: Joint Parties

When a client is a joint client, the merge fields are not limited to one or two members the merge-field format is:

«=client.joint_party_<position>_<field>»

The following fields are also available for members of a joint party:
Merge Field
Description
«=client.joint_party_n_position»Position of the joint party.
«=client.joint_party_n_primary»Indicates whether the joint party is the primary party.
«=client.joint_party_n_party_type»Type of party (contact or organisation).
«=client.joint_party_n_name»Name of the joint party.
«=client.joint_party_n_salutation»Salutation of the joint party.
«=client.joint_party_n_first_name»First name of the joint party (contact only).
«=client.joint_party_n_middle_name»Middle name of the joint party (contact only).
«=client.joint_party_n_last_name»Last name of the joint party (contact only).
«=client.joint_party_n_job_title»Job title of the joint party.
«=client.joint_party_n_email»Email address of the joint party.
«=client.joint_party_n_home_phone»Home phone number of the joint party.
«=client.joint_party_n_business_phone»Business phone number of the joint party.
«=client.joint_party_n_mobile_phone»Mobile phone number of the joint party.
«=client.joint_party_n_tax_number»Tax or VAT registration number of the joint party.
«=client.joint_party_n_domain_name»URL for the joint party's website.
«=client.joint_party_n_address_1»Address line 1 of the joint party's address.
«=client.joint_party_n_address_2»Address line 2 of the joint party's address.
«=client.joint_party_n_address_3»Address line 3 of the joint party's address.
«=client.joint_party_n_address_city»City of the joint party's address.
«=client.joint_party_n_address_region»Region or state of the joint party's address.
«=client.joint_party_n_address_country»Country of the joint party's address.
«=client.joint_party_n_address_postcode»Postcode or ZIP code of the joint party's address.
«=client.joint_party_n_dx_number»DX number of the joint party.
«=client.joint_party_n_dx_exchange»DX exchange of the joint party.
«=client.joint_party_n_full_address»Full address of the joint party in a single line.
«=client.joint_party_n_full_address_block»Full address of the joint party arranged in block format.
«=client.joint_party_n_full_address_linear»Full address of the joint party arranged in linear format.

Fields: Matter

The following merge fields are available for the current matter:
Merge Field
Description
«=matter.matter_code»Unique identifier of the matter record
«=matter.name»Name of the matter
«=matter.client_reference»
Unique client reference for the matter
«=matter.type»Type of the matter
«=matter.currency»
Currency of the matter
«=matter.open_date»Date when matter was first opened
«=matter.open_date_day»
Day of the matter's opening date (e.g. 3)
«=matter.open_date_day_ordinalize»
Day with ordinal suffix (e.g. 3rd)
«=matter.open_date_month_number»
Month as a number (e.g. 1)
«=matter.open_date_month_shortname»
Abbreviated month name (e.g. Jan)
«=matter.open_date_month_longname»
Full month name (e.g. January)
«=matter.open_date_year_4digit»
Four-digit year (e.g. 2026)
«=matter.open_date_year_2digit»
Two-digit year (e.g. 26)
«=matter.open_date_year_4digit_words»
Four-digit year in words
«=matter.open_date_year_2digit_words»
Two-digit year in words
«=matter.close_date»
Date when matter was closed
«=matter.close_date_day»
Day of the matter's close date (e.g. 3)
«=matter.close_date_day_ordinalize»
Day with ordinal suffix (e.g. 3rd)
«=matter.close_date_month_number»
Month as a number (e.g. 1)
«=matter.close_date_month_shortname»
Abbreviated month name (e.g. Jan)
«=matter.close_date_month_longname»
Full month name (e.g. January)
«=matter.close_date_year_4digit»
Four-digit year (e.g. 2026)
«=matter.close_date_year_2digit»
Two-digit year (e.g. 26)
«=matter.close_date_year_4digit_words»
Four-digit year in words (e.g. two thousand and twenty-six)
«=matter.close_date_year_2digit_words»
Two-digit year in words (e.g. twenty-six)
«=matter.estimated_hours»Estimated hours for the matter
«=matter.estimated_expenses»Estimated expenses/disbursements for the matter
«=matter.estimated_fees»
Estimated fees for the matter
«=matter.billing_value
The billing value recorded against the matter
«=matter.owner_name»
Full name of the user assigned to the matter
«=matter.owner_email»
Email address of the user assigned to the matter
«=matter.owner_job_title»
Job title of the user assigned to the matter
«=matter.owner_business_phone»
Phone number of the matter owner
«=matter.owner_department»
Department of the matter owner
«=matter.owner_code»
User code of the matter owner
«=matter.supervisor_code»
User code of the matter supervisor
«=matter.owner_signature»
Signature of matter owner
«=matter.supervisor_signature»
Signature of matter supervisor

Fields: Matter Contact

The following merge fields are available for the related matter contact which has a type of 'Restrict to one'

Merge Field
Description
«=matter.<relationship_type>_name»Full name of the related matter contact
«=matter.<relationship_type>_salutation»Salutation of the related matter contact
«=matter.<relationship_type>_first_name»First name of the related matter contact
«=matter.<relationship_type>_middle_name»Middle name of the related matter contact
«=matter.<relationship_type>_last_name»Last name of the related matter contact
«=matter.<relationship_type>_job_title»Job title of the related matter contact
«=matter.<relationship_type>_email»Email address of the related matter contact
«=matter.<relationship_type>_home_phone»Home phone number of the related matter contact
«=matter.<relationship_type>_business_phone»Business phone number of the related matter contact
«=matter.<relationship_type>_mobile_phone»Mobile phone number of the related matter contact
«=matter.<relationship_type>_address_1»First line of the related matter contact's address
«=matter.<relationship_type>_address_2»Second line of the related matter contact's address
«=matter.<relationship_type>_address_3»Third line of the related matter contact's address
«=matter.<relationship_type>_city»City of the related matter contact's address
«=matter.<relationship_type>_region»Region or state of the related matter contact's address
«=matter.<relationship_type>_country»Country of the related matter contact's address
«=matter.<relationship_type>_postcode»Postcode of the related matter contact's address

Fields: Opportunity

The following merge fields are available for the current opportunity:

Merge Field
Description
«=opportunity.opportunity_code»
Unique identifier of the opportunity record
«=opportunity.name»Name of the opportunity
«=opportunity.stage»Current stage of the opportunity
«=opportunity.open_date»Date when the opportunity was created
«=opportunity.open_date_day»
Day of the opportunity's opening date (e.g. 3)
«=opportunity.open_date_day_ordinalize»
Day with ordinal suffix (e.g. 3rd)
«=opportunity.open_date_month_number»
Month as a number (e.g. 1)
«=opportunity.open_date_month_shortname»
Abbreviated month name (e.g. Jan)
«=opportunity.open_date_month_longname»
Full month name (e.g. January)
«=opportunity.open_date_year_4digit»
Four-digit year (e.g. 2026)
«=opportunity.open_date_year_2digit»
Two-digit year (e.g. 26)
«=opportunity.open_date_year_4digit_words»
Four-digit year in words (e.g. two thousand and twenty-six)
«=opportunity.open_date_year_2digit_words»
Two-digit year in words (e.g. twenty-six)
«=opportunity.close_date»Expected or actual close date of the opportunity
«=opportunity.close_date_day»
Day of the opportunity's close date (e.g. 3)
«=opportunity.close_date_day_ordinalize»
Day with ordinal suffix (e.g. 3rd)
«=opportunity.close_date_month_number»
Month as a number (e.g. 1)
«=opportunity.close_date_month_shortname»
Abbreviated month name (e.g. Jan)
«=opportunity.close_date_month_longname»
Full month name (e.g. January)
«=opportunity.close_date_year_4digit»
Four-digit year (e.g. 2026)
«=opportunity.close_date_year_2digit»
Two-digit year (e.g. 26)
«=opportunity.close_date_year_4digit_words»
Four-digit year in words (e.g. two thousand and twenty-six)
«=opportunity.close_date_year_2digit_words»
Two-digit year in words (e.g. twenty-six)
«=opportunity.estimated_hours»Estimated hours for the opportunity
«=opportunity.estimated_fees»Estimated fees for the opportunity
«=opportunity.estimated_expenses»Estimated expenses for the opportunity
«=opportunity.currency»Currency assigned to the opportunity
«=opportunity.owner_name»Full name of the user assigned to the opportunity
«=opportunity.owner_email»Email address of the user assigned to the opportunity
«=opportunity.owner_job_title»Job title of the user assigned to the opportunity
«=opportunity.owner_business_phone»Business phone number of the user assigned to the opportunity
«=opportunity.supervisor_signature»Signature of the opportunity supervisor
«=opportunity.opportunityable_name»Name of the client or entity associated with the opportunity
«=opportunity.client_reference»Client reference recorded against the opportunity

Fields: Custom

The following types of custom fields are supported for use in the merge process:
  1. Client (Organization/Contact)
  2. Matter
To include a custom merge field, you simply prefix the name of the custom field as follows:
  1. «=client.industry_sector»
client = the name of the data type (e.g., client or matter)
industry_sector = the name of the custom field in lower case with an underscore between each word.

Fields: Linked Data Table Records

A Matter custom field with the type Linked data record can merge values from the selected data-table record.

For example, if a Matter custom field is named Site and it is linked to a data table with a Name column:
  1. «=matter.site_name»
For a data-table column named Postcode, use:
  1. «=matter.site_postcode»
Field names are lowercase, with spaces replaced by underscores. The merge-field format is:
  1. «=matter.<linked_custom_field_name>_<data_table_column_name>»

Fields: Data Tables - Lists

Where a data table can contain more than one record for a Matter, use a SablonPlus loop to repeat content for every related record.

For example, a data table named Financial Incentives is available in templates as:
  1. «matter.financial_incentives»
To create a list, insert these merge fields:
  1. «matter.financial_incentives:each(incentive)»
  2. «=incentive.record_name» - «=incentive.amount»
  3. «matter.financial_incentives:endEach»
Document Automation: Getting Started