Example Quote Template Document
Managing Merge Fields in Microsoft Word
Refer to the example dynamic quote document above for examples.
Whenever you want the document to display something, it must have an "=" in front of the value. e.g. the following merge field value WILL show the quote number in a document:
=quote.quote_number
Whereas the following will not:
quote.quote_number
The only time you likely won't want to add an "=" in front of the merge field value is when iterating over something, like line items within a quote section. In that scenario, if you want to simply display the line item name per line within a quote section and nothing else, the following would be valid.
section.quote_lines:each(line_item)
=line_item.name
section.quote_lines:endEach
In the above scenario, we don't want to display the "each" concept which allows us to loop through the quote lines within a section, but we do want to display the name of each line item.
The quote template example above is a great reference for these concepts.
Proposal Document Merge Fields Reference
This document provides a comprehensive list of all available merge fields for Word quote document templates in Drum.
Quote Details
Basic Quote Information
quote.quote_number - The unique quote number generated upon quote creation
quote.name - Alias for quote_number
quote.title - The title of the quote
quote.description - The contents of the description field from the quote page
quote.status - Current status of the quote (draft, awaiting_approval, approved, sent, cancelled, accepted, declined)
quote.currency - The currency code for the quote
Quote Dates
quote.sent - The formatted date when the quote was marked as "sent" in Drum (format: "dd Month YYYY")
quote.sent_at - Raw datetime when the quote was sent
quote.expiry - The formatted expiry date (format: "dd Month YYYY")
quote.expiry_date - Raw expiry date
Quote Financial Totals
quote.total - The total value of the quote including tax
quote.total.format - The formatted total value with currency symbol
quote.total_excluding_tax - The total value excluding tax
quote.total_excluding_tax.format - The formatted total excluding tax with currency symbol
quote.tax_amount - The total tax amount calculated for the quote
quote.tax_amount.format - The formatted tax amount with currency symbol
Quote Sections and Lines
Iterating Through Sections
To iterate through each quote section within your Drum quote, use the following syntax in your Word template:
quote_sections:each(section)
[Your section content here]
quote_sections:endEach
Section Fields
Within the section iteration block, you can access:
section.name - The name of the quote section
section.description - The description of the section
section.position - The position of the section (starting from 1)
section.total - The total of the section including tax
section.total.format - Formatted section total with currency symbol
section.total_excluding_tax - The section total excluding tax
section.total_excluding_tax.format - Formatted section total excluding tax with currency symbol
section.tax_amount - The tax amount calculated for that section
section.tax_amount.format - Formatted tax amount with currency symbol
Line Items
Within each section, you can iterate through quote line items. Note: Line item iteration must be performed within the quote_sections:each(section) block.
section.quote_lines:each(line_item)
[Your line item content here]
section.quote_lines:endEach
Line Item Fields
Within the line item iteration block, you can access:
line_item.name - The name or description of the line item
line_item.quantity - The quantity for the line item
line_item.position - The position of the line item within its parent section (starting at 1)
line_item.price - The unit price of the line item
line_item.price.format - Formatted unit price with currency symbol
line_item.discount - Any discount applied to the line item
line_item.discount.format - Formatted discount with currency symbol
line_item.total - The total of that line including tax
line_item.total.format - Formatted line total with currency symbol
line_item.total_excluding_tax - The line total excluding tax
line_item.total_excluding_tax.format - Formatted line total excluding tax with currency symbol
line_item.tax_amount - The tax amount for that line (calculated as total - total_excluding_tax)
line_item.tax_amount.format - Formatted tax amount with currency symbol
Project/Opportunity Details
Basic Project Information
project.name - The name of the opportunity/project that the quote belongs to
project.name_uppercase - The project name in uppercase
project.description - The description of the parent opportunity/project
project.description_uppercase - The project description in uppercase
project.project_number - The project/opportunity number
project.name_with_number - Combined project number and name (format: "PROJECT-001 - Project Name")
project.combo_name - Full project identifier with client name
project.project_type - Type of project (opportunity or project)
project.start_date - Project start date
project.end_date - Project end date
project.target_date - Target completion date
project.due_date - Due date (if enabled for opportunities)
Project Address
address.summary - A summarized version of the project's primary address
address.line_one - First line of the project address
address.line_two - Second line of the project address
address.suburb - Suburb/city of the project address
address.state - State/province of the project address
address.post_code - Postal/zip code of the project address
address.country - Country of the project address
Client/Company Details
Company Information
company.name - The trading name or legal name of the company
company.trading_name - The trading name of the company
company.legal_name - The legal name of the company
company.email - Company email address
company.phone - Company phone number
company.tax_number - Company tax/ABN number
company.client_number - Internal client number (if client numbering is enabled)
company.combo_name - Client number and name combined (format: "#123 Company Name")
Client Address
client_address.summary - The summarized address for the quote's associated company
client_address.line_one - First line of the client address
client_address.line_two - Second line of the client address
client_address.suburb - Suburb/city
client_address.state - State/province
client_address.post_code - Postal/zip code
client_address.country - Country
Contact Details
Primary Contact
primary_contact.name - The full name of the primary contact
primary_contact.full_name - Alternative for full name
primary_contact.first_name - First name of the primary contact
primary_contact.last_name - Last name of the primary contact
primary_contact.title - Job title of the primary contact
primary_contact.email - Email address of the primary contact
primary_contact.mobile_phone - Mobile phone number
primary_contact.office_phone - Office phone number
primary_contact.summary - Combined name and title (format: "John Smith - Manager")
primary_contact.summary_with_contact - Full contact details summary
General Fields
date - The formatted date when the quote document was created (format: "dd Month YYYY")
Custom Fields
Company Custom Fields
If the project is for an external client, any custom fields defined for companies will be available using the field label converted to a merge field format. For example:
A custom field with label "Industry Sector" becomes available as industry_sector
A custom field with label "Client Reference Number" becomes available as client_reference_number
Project Custom Fields
Any custom fields defined for the project are available using the field label converted to a merge field format. The system handles different value types (text, date, number) automatically. For example:
A custom field with label "Project Manager" becomes available as project_manager
A custom field with label "Contract Value" becomes available as contract_value
A custom field with label "Completion Date" becomes available as completion_date
The conversion process:
Takes the custom field label
Converts to lowercase
Replaces spaces with underscores
Removes special characters
Usage Tips
Formatting Money Values
Most monetary fields support two formats:
Without .format suffix: Returns the raw number
With .format suffix: Returns the formatted value with currency symbol
Example:
quote.total might return: 10000.00
quote.total.format might return: $10,000.00
Handling Missing Data
When a field doesn't have data (e.g., no primary contact), the merge field will be replaced with an empty string. Consider using conditional logic in your Word template to handle these cases gracefully.
Date Formatting
Formatted date fields (like quote.sent, quote.expiry) return dates in "dd Month YYYY" format (e.g., "15 January 2025")
Raw date fields return the underlying date/datetime value which can be formatted using Word's date formatting features
Notes
All fields are case-sensitive
Empty or nil values are replaced with empty strings in the final document
The service automatically fetches the appropriate template document (from the quote template)
Context is built dynamically when the document is generated, ensuring all values are current