Docs
On this page
task2 min readApplication: Platform

Create a template report

Generate a PDF from a Word or Excel template filled by a script, and run it manually, from a table operation or on a schedule.

A template report fills a Word or Excel template with data a script extracts, and produces a PDF. Create one when you need a formatted tabular document, such as a daily ticket summary or a record exported to a fixed layout.

Before you begin

  • You need the administrator role. Only administrators see the template report menu items.
  • Prepare the Word or Excel template with placeholders for the data. The placeholder syntax is in Template report scripts.
  • Query only the data the report needs, for example records created or closed in the last day, week or month. Large queries slow the report down.

Steps

  1. Select Reporting → Reports → New template report.

  2. Enter a Name and a Description. If the instance is multilingual (system.multilingual is true), also fill in LocalizedName and LocalizedDescription, which are then used instead.

  3. Enter a Key. Table operations and scheduled reports refer to the template report by this key.

  4. Attach the Word or Excel document to Template.

  5. Write the Script that extracts the data and sets answer. The script can read a context object to specialise the data.

  6. Save the template report, then run its table operation on the form to test it. Enter a context in the dialog, for example a table and a record ID, and run it.

  7. Check the generated PDF. Adjust the script or the template until the output is right.

Variations

Run from a table operation

To export a record to the template from its form, create a client-side table operation on the record’s table. Its script builds the context and calls Navigate.viewTemplateReport with the template report’s key. See Table operations.

let context = { id: current.getID(), table: current.getTableName() };

Navigate.viewTemplateReport("ServicelyReport", context);

Run on a schedule

Add the template report to the Template reports field of a scheduled report. The scheduled report’s Context script supplies the context. See Schedule a report.

Result

Running the template report produces a PDF built from the template and the script’s data. From a table operation, the PDF opens for the current record. From a scheduled report, each recipient receives one PDF attachment per template report.

Last updated 18 October 2026commit 50111ae9bd3bChris Jones
Back to top