/
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.
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.
, multiple selections available,
Related content
Scripted Reports input parameters
Scripted Reports input parameters
Read with this
Input parameters
Input parameters
Read with this
Scripted Reports API (SR API)
Scripted Reports API (SR API)
Read with this