Skip to product menu
Skip to main content

Dynamic Select

  • The drop-down menu is a clear method of showing a list of data, allowing users to pick their choice from the list.
  • This input field is controlled by the dynamic field handler.

Note: For optimum results configure the dynamic_select field only when the search results are more than 100. In case of results lesser than 100, use the select field. 

Attribute NameDatatype Description
type*String 
(Value should be dynamic_select)
The type of the input field. Value of the field should be dynamic_select.
placeholder*String (150)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. Upon form submission, value defined for this key will be available in the function associated with the form.
label*String (150)Describes the display name for this field.
hintString (100)Provides a brief description of the fields purpose and the expected input.
valueString(100)Provide a default input value for the field.  
mandatoryBooleanDefines if the field's requisite is mandatory or not. 
Note: Default value is considered to be false.
options*Array

An array of JSON object following the structure label and value. This attribute will be considered only when the datasource is list.

Max no of elements - 100
{
label : $label,    (Maximum allowed characters: 100)
value : $value   (Maximum allowed characters: 100)

}

Note: The first level of options can have another set of options.

multipleBooleanDefine if your drop-down should be a single select or multi select field. For 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.

auto_search_min_resultsInteger
Default: 5
The number of drop-down items to be populated when the search results are less than this count.
min_charactersIntegerMinimum number of characters required to trigger the search. 
disabledBooleanIf disabled is true, then the field will not be editable
trigger_on_changeBooleanIf this is enabled for a field or an input, then the change handler will be invoked when the value of that field is changed

Sample Code:

Copied{
    "type":"dynamic_select",
    "name":"country",
    "hint":"Select the country",
    "label":"Select the country. You can search for any",
    "mandatory":false,
    "multiple":true,
    "trigger_on_change":true,
    "options":countriesList,
    "placeholder":"Type to search for a country"
    "auto_search_min_results":5,
    "min_characters":1,
    "max_selections":2,
    "disabled" : false
    
}
// countriesList = {{"label":"Afghanistan","value":"AF"},{"label":"Albania","value":"AL"},{"label":"Algeria","value":"DZ"},{"label":"Antarctica","value":"AQ"},{"label":"Argentina","value":"AR"},{"label":"Australia","value":"AU"},{"label":"Austria","value":"AT"},{"label":"Bahamas","value":"BS"},{"label":"Bangladesh","value":"BD"}}

JSON format passed in handlers for the filled-in value:

Copied{
   "meta":{
      "type":"dynamic_select",
      "value":"Algeria"
   },
   "value":[
      {
        "label":"Algeria",
         "value":"DZ"
      }
   ]
}