×îв©²ÊÍøÕ¾

Drop-down Menu: Developer Defined

The drop-down menu is a clear method of showing a list of data, allowing users to pick their choice from the list. This field can be categorized into two types based on the choice of selection types offered. 

Single select drop-down

The single select drop-down field allows users to choose a single option from a menu. The items in the drop-down menu can be either grouped or displayed individually. The grouping of menu items can be handled with the options array attribute. Below is a list of the attributes used for the single select drop-down field. All mandatory fields are marked with an asterisk *, and the maximum character limits for each field are also provided, along with their data types.

Attribute NameData Type & LimitDescription
type*String
Value should be select
The type of input field. For drop-down menu type must be select

placeholder*

 

String (100)Sample field value displayed to the user that describes the expected value of the input field.
name*String (50)A unique identifier for the field. On form submission, the value defined for this key will be available in the function associated with the form. 

Note: Allowed characters are alphabets (lowercase and uppercase), numbers, underscore (_) and hyphen (-).
a-z, A-Z, 0-9, _, -
hintString (100)Provides a brief description of the field's purpose and the expected input.
label*String (50)The field's display name.
mandatoryBooleanDefines if the field's requisite is mandatory or not.
Default value considered is true
options*Array

An array of JSON objects following the structure label and value. This attribute will be considered only when the data source is list. Maximum number of elements - 100

Attribute Name

Data Type & Limit

Description

label

String

Mandatory 

Maximum allowed characters: 100

The display name of the option shown to the user.
value

String

Mandatory

Maximum allowed characters: 100

A unique identifier for the option
thumbnail

String

Optional

Maximum allowed characters:  500

Icon or image representing the option
description

String

Optional

Maximum allowed characters: 150

Short text providing additional context or details about the option

Syntax:

{
   label : $label,  
   value : $value  
   thumbnail: $url, description: $description
}
(or)
{
   options : [ { $label, $value, $thumbnail , description: $description} ]
}

ⓘ Note:

1. Allowed characters for "value" are alphabets (lowercase and uppercase), numbers, underscore (_), hyphen (-), at (@), hash (#), period (.) and colon (:) 
 a-z, A-Z, 0-9, _, -, @, #, ., :

2. The first level of options can have another set of options.

valueString

Provide a default input for the field by giving the value of any drop-down list item.

Note: The value provided must match the value fields of any drop-down menu item. 

Developer defined dropdown without grouping

Syntax :
{
  "type": "select",
  "name": "",
  "label": "",
  "hint": "",
  "placeholder": "",
  "mandatory": true, //default value is set as true
  "value": "",
  "options": [
    {
      "label": "",
      "value": "",
      "thumbnail":"",
      "description":""
    }
  ]
}
Code Sample :
// Single select without grouping
inputs = list();
inputs.add({
  "type": "select",
  "name": "teammem",
  "label": "Select User",
  "hint": "Choose a user to add to your team",
  "placeholder": "Search or select a user",
  "mandatory": true,
  "value": "olivia",
  "options": [
    {
      "label": "Scott Fisher",
      "value": "scott",
      "thumbnail": "/sites/zweb/images/cliq/commands/man_shallow.webp",
      "description": "Project lead with 5+ years in software development"
    },
    {
      "label": "Li Ju ng",
      "value": "li",
      "thumbnail": "/sites/zweb/images/cliq/commands/smiling_woman.webp",
      "description": "UX designer with a passion for user-first interfaces"
    },
    {
      "label": "Olivia Palmer",
      "value": "olivia",
      "thumbnail": "/sites/zweb/images/cliq/commands/woman_white_shirt.webp",
      "description": "Team coordinator managing internal and client comms"
    }
  ]
});

form = {
  "type": "form",
  "title": "Add Team Member",
  "hint": "Assign a user to your team for collaboration",
  "name": "notifier",
  "version": 1,
  "button_label": "Add User",
  "action": {
    "type": "invoke.function",
    "name": "adduser"
  },
  "inputs": inputs
};
return form;

Developer defined dropdown with grouping

Syntax:
{
  "type": "select",
  "name": "",
  "label": "",
  "hint": "",
  "placeholder": "",
  "mandatory": true,
  "value": "",
  "options": [
    {
      "label": "",
      "options": [
        {
          "label": "",
          "value": "",
          "thumbnail": "",
          "description":""
        },
        {
          "label": "",
          "value": "",
          "thumbnail": "",
          "description":""
        }
      ]
    },
    {
      "label": "",
      "options": [
        {
          "label": "",
          "value": "",
          "thumbnail": "",
          "description":""
        },
        {
          "label": "",
          "value": "",
          "thumbnail": "",
          "description":""
        }
      ]
    }
  ]
}

Quick Tip:

All input field types given here are explained with a sample code snippet. Try out these snippets by creating a slash command.

Code Sample:
// Single select with grouping
inputs = list();
inputs.add({
  "type": "select",
  "name": "team",
  "label": "Select Team",
  "hint": "Choose the team the user belongs to",
  "placeholder": "Select a team from the list",
  "mandatory": true,
  "value": "devops",
  "options": [
    {
      "label": "Zylcal",
      "options": [
        {
          "label": "Zylcal Dev-ops",
          "value": "devops",
          "description": "Handles deployment, infrastructure, and CI/CD pipelines"
        },
        {
          "label": "Zylcal QA",
          "value": "qa",
          "description": "Responsible for testing, quality checks, and bug tracking"
        },
        {
          "label": "Zylcal Marketing",
          "value": "marketing",
          "description": "Drives branding, campaigns, and user engagement for Zylcal"
        }
      ]
    },
    {
      "label": "Zyltrix",
      "options": [
        {
          "label": "Finance",
          "value": "finance",
          "description": "Manages budgets, invoices, and financial reports"
        },
        {
          "label": "Accounts",
          "value": "accounts",
          "description": "Handles billing, audits, and transaction records"
        },
        {
          "label": "HR",
          "value": "hr",
          "description": "Oversees recruitment, policies, and employee welfare"
        }
      ]
    }
  ]
});
form = {
  "type": "form",
  "title": "Assign Team",
  "hint": "Assign the selected user to a specific team",
  "name": "notifier",
  "version": 1,
  "button_label": "Assign",
  "action": {
    "type": "invoke.function",
    "name": "adduser"
  },
  "inputs": inputs
};
return form;

Multi select drop-down

The multi select drop-down field allows users to choose multiple items from the menu list. The maximum number of items that can be selected is defined using the max_selections attribute. Below given are the list of attributes passed for the multi select drop-down field.

Note: Multi select drop-downs can also be listed with or without grouping!

Attribute NameData TypeDescription
type*string
Value should be select
The type of input field. For drop-down menu type must be select
placeholder*string (100)Sample field value displayed to the user that describes the expected value of the input field.
name*string (50)A unique identifier for the field. On form submission, the value defined for this key will be available in the function associated with the form. 

Note: Allowed characters are alphabets (lowercase and uppercase), numbers, underscore (_) and hyphen (-).
a-z, A-Z, 0-9, _, -
hintstring (100)Provides a brief description of the field's purpose and the expected input.
label*string (50)The field's display name.
mandatorybooleanDefines if the field's requisite is mandatory or not.
Default value considered is true
options*array

An array of JSON objects following the structure label and value. This attribute will be considered only when the data source is list. Maximum number of elements - 100

Attribute Name

Data Type & Limit

Description

label

String

Mandatory 

Maximum allowed characters: 100

The display name of the option shown to the user.
value

String

Mandatory

Maximum allowed characters: 100

A unique identifier for the option
thumbnail

String

Optional

Maximum allowed characters:  500

Icon or image representing the option
description

String

Optional

Maximum allowed characters: 150

Short text providing additional context or details about the option

Syntax:

{
   label : $label,  
   value : $value  
   thumbnail: $url, description: $description
}
(or)
{
   options : [ { $label, $value, $thumbnail , description: $description} ]
}

ⓘ Note:

1. Allowed characters for "value" are alphabets (lowercase and uppercase), numbers, underscore (_), hyphen (-), at (@), hash (#), period (.) and colon (:) 
 a-z, A-Z, 0-9, _, -, @, #, ., :

2. The first level of options can have another set of options.

valuestring

Provide a default input for the field by giving the value of any drop-down list item.

Note: The value provided must match the value fields of any drop-down menu item. 

multiple*booleanFor all multi select fields, multiple should be set as true
max_selectionsinteger 
Maximum selections: 10

Defines the number of options that a user can choose from the drop-down. 

Note: Value for this field defaults to 1 in case of single select drop-downs.

Developer defined dropdown multiple select without grouping

Syntax:
{
  "type": "select",
  "max_selections":"",
  "multiple":true
  "name": "",
  "label": "",
  "hint": "",
  "placeholder": "",
  "mandatory": true, //default value is set as true
  "value": "",
  "options": [
    {
      "label": "",
      "value": "",
      "thumbnail": "",
      "description":""
    }
  ]
}

Quick Tip:

All input field types given here are explained with a sample code snippet. Try out these snippets by creating a slash command.

Code Sample:
//Multi select without grouping
inputs = list();
inputs.add({
  "type": "select",
  "name": "clients",
  "label": "Select Clients",
  "hint": "Choose clients associated with the project",
  "placeholder": "Select clients",
  "multiple": true,
  "max_selections": "3",
  "mandatory": false,
  "options": [
    {
      "label": "Daniel Rivera",
      "value": "daniel",
      "thumbnail": "/sites/zweb/images/cliq/commands/man_shallow.webp"
    },
    {
      "label": "Emma Watson",
      "value": "emma",
      "thumbnail": "/sites/zweb/images/cliq/commands/smiling_woman.webp"
    },
    {
      "label": "Liam Brooks",
      "value": "liam",
      "thumbnail": "/sites/zweb/images/cliq/commands/woman_white_shirt.webp"
    },
	{
      "label": "Robin Sawyer",
      "value": "robin",
      "thumbnail": "/sites/zweb/images/cliq/commands/greytshirtuser.png"
    }
  ]
});

form = {
  "type": "form",
  "title": "Add Users & Clients",
  "hint": "Assign team members and link relevant clients",
  "name": "notifier",
  "version": 1,
  "button_label": "Submit",
  "action": {
    "type": "invoke.function",
    "name": "adduser"
  },
  "inputs": inputs
};
return form;

Developer defined dropdown multiple select with grouping

Syntax:
{
  "type": "select",
   "max_selections":"",
  "multiple":true,
  "name": "",
  "label": "",
  "hint": "",
  "placeholder": "",
  "mandatory": true,
  "value": "",
  "options": [
    {
      "label": "",
      "options": [
        {
          "label": "",
          "value": "",
          "thumbnail": "",
          "description":""
        },
        {
          "label": "",
          "value": "",
          "thumbnail": "",
          "description":""
        }
      ]
    },
    {
      "label": "",
      "options": [
        {
          "label": "",
          "value": "",
          "thumbnail": "",
          "description":""
        },
        {
          "label": "",
          "value": "",
          "thumbnail": "",
          "description":""
        }
      ]
    }
  ]
}
Code Sample:
//Multi select with grouping
inputs = list();
inputs.add({
   "type":"select",
   "max_selections":"4",
   "multiple":true,
   "name":"team",
   "label":"Team",
   "hint":"Select a team",
   "placeholder":"Choose your team from the menu",
   "mandatory":true,
   "value":"devops",
   "options":{
      {
         "label":"Zylcal",
         "options":{
            {
               "label":"Zylcal Dev-ops",
               "value":"devops",
               "thumbnail":"/sites/zweb/images/cliq/finance_illustrations.png"
            },
            {
               "label":"Zylcal QA",
               "value":"qa",
               "thumbnail":"/sites/zweb/images/cliq/finance_illustrations.png"
            },
            {
               "label":"Zylcal Marketing",
               "value":"marketing",
               "thumbnail":"/sites/zweb/images/cliq/icons/qa_marketing_image.png"
            }
         }
      },
      {
         "label":"Zyltrix",
         "options":{
            {
               "label":"Finance",
               "value":"finance",
               "thumbnail":"/sites/zweb/images/cliq/finance_illustrations.png"
            },
            {
               "label":"Accounts",
               "value":"accounts",
               "thumbnail":"/sites/zweb/images/cliq/icons/accounts_illustrations.jpg"
            },
            {
               "label":"HR",
               "value":"hr",
               "thumbnail":"/sites/zweb/images/cliq/icons/hr_models_cover.webp"
            }
         }
      }
   }
});
form ={
   "type":"form",
   "title":"Add user",
   "hint":"Add user to a team",
   "name":"notifier",
   "version":1,
   "button_label":"Add",
   "action":{
      "type":"invoke.function",
      "name":"adduser"
   },
   "inputs":inputs
};
return form;