Skip to main content

Recipes

This page includes helpful snippets for usage in your templates.

Initial context

Displays the initial context within which the template is executed.

```json
{{{json @root}}}
```

Please take a look at the documentation for Handlebars variables.

Iterate through all fields in each record

The Render template toggle should be set as All rows in the plugin options.

{{#each data}}
{{#each this}} {{@key}}: {{this}} {{/each}}
{{/each}}

Conditional content

This snippet shows how to display different content based on specific conditions.

{{#if (eq app "auth")}}
This is the auth app.
{{else}}
This is not an auth app.
{{/if}}

Specific row in the data

To reference a specific row in the returned dataset, set the Render template toggle as All rows.

{{data.4.title}}

Handlebars variables

This snippet shows how to iterate through an array of data and display the title of the third item of the array with the @index variable.

{{#each data}}
{{#if (eq @index 3)}}
{{title}}
{{/if}}
{{/each}}