Set up the Template for a Custom List

It is possible to set up a custom list, and the end user can select an item from that list when creating a message. For example, such a list could be to select a city from a drop-down list to get the proper weather feed for that city.

To configure the template, you will need to edit the .html file (see Update the HTML File) and .json file (see Update the params.json File). You will also need to have a javascript (.js) file.


The .html file must have a div class that will contain the custom choices offered to the end user – in our example, it is a list of cities:

<div class="text-content">
    <h1>Current weather in <span id="city"></span></h1>
    <h1 id="currentWeather"></h1>
    <h2 data-bali-id="City">6077243</h2>

The .html file must also contain a line that points to a local javascript file (for example, template.js) :

<script src="template.js"></script>

Javascript File

The template.js file must contain the proper information for your custom choices (in our example, the weather feed):

$(document).ready(() => {
  $('[data-bali-id="City"]').bind("DOMSubtreeModified", handleWeatherAPI);

  function handleWeatherAPI() {
    const cityID = $('[data-bali-id="City"]').text().trim();
    if (cityID) {
        "" +
          cityID +
        function (res) {
          var tempInCelcius = kelvinToCelcius(res.main.temp);
          $("#currentWeather").text(tempInCelcius + " °C");


function kelvinToCelcius(kelvin) {
  return parseFloat(kelvin - 273.15).toFixed(1);


The params.json file must have a corresponding section that contains the custom choice offered to the end user (in our example, a list of cities):

  "orientation": "landscape",
  "fields": [
      "id": "City",
      "label": "Choose your city",
      "default": "6077243",
      "choices": [
        { "label": "Montreal", "value": "6077243" },
        { "label": "Kitchener", "value": "5992996" }
      "type": "variable",
      "mandatory": false