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.

Parameters

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.

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 the folder.
namestringThe name of the folder.
descriptionstringThe description of the folder.
attachmentsAttachment[]A list of attachments in the folder (i.e., non-image files).
imagesImage[]A list of images in the folder.
fieldsdictA dictionary mapping custom field names to custom field values.

Attachment Properties

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

Image Properties

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

Parameters

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 the snapshot.
titlestringThe title of the snapshot.
descriptionstringThe description of the snapshot.
bounds()functionGet a URL to access the snapshot’s region image.

Signer Properties

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