The Handlebars connector uses commands in a chain to render Handlebars templates with variables replaced with provided values.
Note: To use Handlebars, we recommend a basic understanding of its templating language and expressions. See our Understanding Handlebars article to learn more.
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.
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}}