/
Template variables (Handlebars)
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.
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.
Related content
Input parameters
Input parameters
Read with this
Scripted Reports input parameters
Scripted Reports input parameters
Read with this
Scripted Reports API (SR API)
Scripted Reports API (SR API)
Read with this