With the Handlebars connector, you can use commands in a chain to render Handlebars templates with variables replaced with provided values.
Requirements
- To make the connector available for use in your organization's chains, an org security administrator must enable it from the Configuration screen.
- The Handlebars connector is based on version 2.0.0 of the Handlebars JavaScript library.
- To use the Handlebars connector, we recommend a basic understanding of the Handlebars templating language and expressions.
Note: For instance, Handlebars templates use double curly brackets—such as
{{VARIABLE_NAME}}
—to indicate variables to replace with values in the rendered output.
Set up the Handlebars connector
- From Chain Builder, click Connections , and then Create at the top right.
- Under BizApp Connection, select Handlebars and the default CloudRunner.
- Under Basic Info, enter a unique name and description to help identify the connection.
- Select the environments to use the connection, and click Save.
Limitations
The Handlebars connector doesn't currently allow you to insert your own helper functions.
For instance, the #if
conditional supports only the built-in boolean function, meaning this code is supported:
{{#if data.job_title}}
This person has a job title.
{{else}}
This person does not have a job title.
{{/if}}
However, this code using the more advanced conditional is not supported:
{{#if (data.job_title == "CEO")}}
This person is the CEO.
{{else}}
This person is not the CEO.
{{/if}}