Common concepts

Templates

Templates are supported by different widgets.

Templates allow you to filter, transform, or even merge your data. For example JSON or YAML.

The templating engine used is Handlebars


Handlebars extensions

A few extension to handlebars have been added

Current time as seconds

{{nowSeconds}}

Current time as milliseconds

{{nowMillis}}

Current time as an ISO 8601 string

{{nowIso}}

Handling HTTP responses

Fan-out example

The HTTP query widget lets you "fan-out" queries. For example if you have a REST endpoint that returns a list of items. You can add a second HTTP query to fetch the details of each of those items - this is the fan-out part since we are executing multiple queries now instead of just one.

You can use a template to merge these multiple queries into a single output.

{{#each data}} 
{{this.steps.[0].id}}, {{this.result.name}}, {{this.result.bytes}}   
{{/each}}
  • #each is how you iterate over a list in Handlebars.
  • data is a list of the fanned out items.
Previous
JSON validation