Placeholder Reference

There are a number of placeholders that can be used within report templates. These include global variables and functions, and various data types.

Global Variables

NameTypeDescription
static_datadictContains the static data specified in the Static Data tab of the report template editor.
folderFolderContains data related to the folder this report is being rendered for.
caseFolderAlias of folder
snapshotsdict{string: Snapshot[]}Snapshots selected by the report generator, grouped by snapshot container. Keys in the dict are the template names specified in the snapshot containers section of the report template editor.
report_signed_bySignerThe signer of the report (if it is signed).
report_signed_atdatetimeWhen the report was signed (if it was signed).

Global Functions

NameDescription
template_file_by_name(name)Get a URL to the file contents of a Report Template File by specifying its name.
template_file_by_id(id)Get a URL to the file contents of a Report Template File by specifying its id.

Params

NameTypeDescription
namestringThe name of the report template file (must be exact).
idstringThe id (10 character alphanumeric) of the report template file.

Data Types

Some commonly used properties for folders, images, attachments and snapshots are listed.

Note: Some properties are omitted for brevity. The pprint filter in Jinja is useful for exploring the available properties in each variable.

Folder properties

NameTypeDescription
idintThe ID of this folder.
namestringThe name of the folder.
descriptionstringThe description of the folder.
attachmentsAttachment[]A list of attachments in this folder (i.e. non-image files).
imagesImage[]A list of images in this folder.
fieldsdictA dictionary mapping custom field names to custom field values.

Attachment properties

NameTypeDescription
idstringThe ID of this file.
namestringThe name of this file.
file_urlstringA URL to access the contents of this file.
filesizeintThe size of this file in bytes.

Image properties

NameTypeDescription
idstringThe ID of this image.
namestringThe name of this image.
filesizeintThe size of this image in bytes.
get_thumbnail(bounds)functionGet a URL to access the thumbnail of this image.
get_region(area, bounds)functionGet a URL to access a region from this image.

Params

NameTypeDescription
areaint[]A region to extract from the image specified as [x, y, width, height] in pixel coordinates of the original image. If omitted or invalid, the requested image is omitted from the report.
boundsint[]A [width, height] pair in pixels that this image will be resized to fit within (if larger). If omitted, the requested image is returned unscaled and if invalid, the requested image is omitted from the report.

Snapshot properties

NameTypeDescription
idintThe ID of this snapshot.
titlestringThe title of this snapshot.
descriptionstringThe description of this snapshot.
boundsfunctionGet a URL to access this snapshot’s region image.

Params

NameTypeDescription
namestringThe name of the user that signed the report.
signaturestringA URL to the signature image of the report signer.