Select

A selection from predefined values

Specification

multiple

  • Type: Boolean

  • Default: False

  • If true, multiple selections are allowed.

sort

  • Type: String

  • Allowed values: text or number

  • Items are unsorted by default. However, you can sort them by using this option.

grouped

  • Type: Boolean

  • If true, options can be grouped by using grouped options syntax.

[
    {
        label: "Group",
        options: [
            {
                label: "Option",
                value: 1
            }
        ]
    }
]

options

  • Available types:

Type
Specification

array

An array of options for this Select. Example:

[
    {
        label: "Option",
        value: 1
    }
]

string

Specifies an Options RPC URL, that will be called to retrieve dynamic options for this selection.

object

Allows specifying the detailed configuration of options and nested parameters for this Select field.

  • Available parameters:

Parameter
Type
Specification

store

array

Specifies options for the select field.

store

string

Specifies an options RPC URL, that will be called to retrieve dynamic options for the select.

label

string

Specifies the name of a property that will be used as the label of an option.

value

string

Specifies the name of a property that will be used as the value of an option. Value cannot be null.

placeholder

string

Specifies the label which will be shown when no option is selected. Available parameters:

  • label (string) Specifies the label which will be shown when no option is selected.

  • nested (array)Specifies an array of nested parameters that are shown when no option is selected.

placeholder

object

Specifies a detailed configuration of a placeholder. Available parameters:

  • label (string) Specifies the label which will be shown when no option is selected.

  • nested (array)Specifies an array of nested parameters that are shown when no option is selected.

nested

array

Specifies an array of nested parameters that are shown when an option is selected.

When the select is multiple, the nested parameters will be generated and displayed for selected options.

nested

string

Specifies an RPC URL, that will be called to retrieve dynamic nested options.

mode

  • Type: String.

  • Accepted values: edit or choose.

  • Specifies the initial mode of select, when editable is true.

validate

  • Type: Object or Boolean.

  • Specifies parameter validation.

When set to false, the validation against the provided options gets disabled for manual input.

Example of Validation
  • Available parameters:

Parameter
Type
Specification

maxItems

number

Specifies the maximal count of selected items when multiple is true.

minItems

number

Specifies the minimal count of selected items when multiple is true.

spec

  • Type: Object.

  • Used for validation is editable is true. If not specified, the value will be passed as is and no validation is performed.

  • Available parameters:

Parameter
Type
Specification

type

string

Specifies a data type of value from the select, which will be validated.

This is usable for example when your API returns numerical IDs in strings but you want them to be typed as numbers in the output of your module.

dynamic

  • Type: Boolean

  • Default: False

  • Defines whether a mapped value in the select should be validated against the option values. If true, the value is treated as a dynamic and validation is disabled. The value is set to true automatically if select options are generated using RPC.

mappable

  • Type: Boolean or Object

    • Set to false to make field non-mappable.

    • If Object, it specifies the detailed configuration of the mapping toggle.

  • Available parameters:

Parameter
Type
Specification

help

string

Alternative help text is shown only when the mappable toggle is turned on.

editable (deprecated)

  • Type: Boolean or Object

  • If Boolean and set to true , the value of select can be edited (or mapped) manually.

  • If Object, specifies a detailed configuration for editable.

  • Available parameters:

Parameter
Type
Specification

enabled

boolean

If set to true , the value of select can be edited (or mapped) manually.

help

string

Alternative help text is shown only when the mappable toggle is turned on.

Examples

Basic Select

A basic select with few options which can't be changed manually.

Example of Basic Select

Select with Grouped Options

By enabling grouped options, you can sort options into groups.

Example of Grouped Options

Multiple Choice

You can turn on multiple choice by setting multiple to true.

Example with Multiple Choice

Multiple Choice with Validation

You can validate the number of selected options by using validate object.

Validation Error after Attempt to Save the Module

Mappable Select with Help

You can display a custom help message when the mappable toggle is turned on.

Example of Help Which Displays after Switching to Mapping Mode

Preselected Value

By setting default, you can set a preselected value. The value of desired option and default has to match to preselect the correct option properly.

Preselected Value "Medium"

Placeholder

You can choose what to display when no option is selected by specifying a placeholder. Notice that you have to put options inside the store array to make this work.

Example of Placeholder

Nested Options

To display a set of fields only when an option is selected, you may use nested options.

Nested Options Size and Notes

Nested Fields for Specific Options

You may want to display certain fields only when a specific option is selected. In this case, you can nest fields under a specific option.

Nested Field for Phone Support Option
Nested Field for Email Support Option

Select Under Select

This is a special case of nested options, which is usable for example for specifying a category and its subcategory.

Select under Sport Option
Select under Music Option

Mode Edit as default

When your select is editable, you can set the default mode edit.

Default Mode Edit

Nested RPCs

You can nest RPCs when retrieving nested fields dynamically. The nested RPC will receive id parameter automatically.

[
   {
       "name": "id",
       "type": "select",
       "mode": "edit",
       "options": {
           "store": "rpc://listBoards",
           "nested": [
               {
                   "name": "member_id",
                   "type": "select",
                   "label": "Member",
                   "options": "rpc://getMemberIdBoard",
                   "required": true
               }
           ]
       },
       "label": "Board ID",
       "required": true
   }
]

Placeholder Nested Fields (deprecated)

To display some fields only when no option is selected, you can use the placeholder object.

Example of Placeholder in a Nested Field

Editable Select (deprecated)

Since Apps platform version 2, all select have set mappable (editable) to true by default.

Last updated