Request templates now use mustache placeholders (for example, {{field}}) to dynamically populate request data to generate proposal PDFs.

For more advanced functionality, including using Mail Merge fields, see documentation from Aspose on Fields.

The list of fields and the general hierarchy of fields of a request can be seen under Settings > Request Templates > Test Fields:

You can also view fields of the request in the auto-generated last page of the request template. This page is automatically added when downloading the template & automatically removed when importing & previewing the template:

Adding Fields

Each field is part of a parent Request "Object" that contains all fields and additional objects related to it. For example, the Contact object has three fields: Email, Name, & Phone.

In general, all fields can be used by using two curly opening curly braces ( {{ ) followed by the name of the field and ending in two ending curly braces ( }} ).

For example:

Contact Name: {{Name}}

Adding Objects/Tables

Each table object is started & ended using two special marker fields:

{{#foreach Request}} - The start of the table object for the "Request" object

{{/foreach Request}} - The end of the table object for the "Request" object

In this example, we see the outermost table of every request with the two special fields used to show where the table starts and ends.

Between the two special marker fields of the table object above, fields of the table object itself may be populated, for example:

{{#foreach Services}}
{{#foreach Items}}
{{Code1}} {{Code2}}
{{/foreach Items}}
{{/foreach Services}}

Some table objects, like Request shown here, will inherently only ever have one item in the table.

However, most other tables may have more than one item that populates them, and any items of the table will have the fields contained within them repeat until the table has been fully printed.

Below is the current structure of the request template for visual reference:

Request - The outermost table object of the template

  • Contact
  • Location
    • Service
      • Item
    • Tax

Formatting Fields

Each field in the request data stream will come with no pre-defined formatting. This is by design as it allows for the highest flexibility in configuring your proposals.

Because of this, most templates will need to take advantage of mail merge formatting fields ability to format themselves.

However, we do have short-hand for currency to help with this (currently the only field type that will likely need formatting).

The below are two ways to write standard rate field with a two decimal format with a dollar sign respecting negative amounts, and the format code below would accomplish this:

{{Rate \Currency}}
{{Rate /# "$#,##0.00;($#,##0.00)"}}

Saving the field / toggling the field codes off will persist the formatting change.

Sample Template