Template variables (Handlebars)

Scripted Reports use the Handlebars library to render templates, so all the "variables," "if statements," and "for loops" can be used for template rendering.

https://handlebarsjs.com/guide/

Script:

const variableObject = { someString: "Hello", someNumber: 42, someArrayOfString: ["w", "o", "r", "l", "d"], }; SR.render(variableObject);

Template:

Static text, {{someString}} {{#each someArrayOfString}} <span>{{this}}</span> {{/each}} {{someNumber}} Static text.