Channel Specific Templates and Customizing JavaScript Responses

If you select “All Channels” as an option in the Channel drop-down of Bot Responses, you can enter your response as either a Plain text or use JavaScript, but the JavaScript will not have any list of templates displayed (see the following screenshot), because one template/JSON may not work for ‘All’ channels.

Key details:

  • If you try to use any JavaScript template for an ‘All channel’ response, the template will be shown as is in JSON format and may not render correctly on the channel. You will need to choose a channel-specific template for rendering a specific template for your channel.
  • If any channel-specific override is present, the platform will use/prefer that over the ‘All channel’ response while responding on that specific channel. For example, if you have a specific message or template for MS Teams, the bot will prefer that while responding to a user over the MS Teams channel and ignore what is mentioned in the ‘All channel’ response.
  • You can have more than one response configured for a channel. The bot will randomly choose if more than one response is configured for any given channel. This holds true for all-channel responses too if no other channel-specific responses are configured.

If your bot has multiple channels, most probably each channel will have its own template.

For a few channel options in the Channel drop-down, you can see a list of templates displayed for JavaScript response. For example, select the Web/Mobile Client channel and choose any template from the Channel Templates list for your response as illustrated below.

For more information on templates, see Widget SDK – Message Formatting and Templates.

The same message configuration rules and principles apply while configuring any entity prompt or KG responses too.

Note: The channel template options are different for each channel. The template definitions provided in the platform are only for reference purposes. Please refer to the documentation of the channel provider to obtain the latest template definitions.

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed