Multi-Field Picker
    • Dark
      Light

    Multi-Field Picker

    • Dark
      Light

    Article summary

    The Multi-Field Picker is a configurable component that allows users to select multiple options from a predefined list. The list of items can be either hardcoded with items or populated with the url attribute.

    Configuration Options

    The picker can be configured through the following options:

    Option

    Type

    Default

    Description

    Options

    fullItem

    boolean

    false

    When true, returns the full item object instead of just the ID

    isSortableList

    boolean

    false

    Determines if the selected list of items is sortable

    numberSelectedByDefault

    number

    0

    Number of items selected by default

    pickedItemsLimit

    number

    null

    Maximum number of items that can be picked

    selectAllByDefault

    boolean

    false

    Selects all items by default if true

    disableApplyWhenEmpty

    boolean

    false

    Disables the apply button when no items are selected

    pickedItemIds

    array

    []

    Default list of IDs of the picked items (optional)

    isRequired

    boolean

    false

    When true, the update button will be disabled until at least one option is selected

    Load Items with URL (for specific list)

    Option

    Type

    Default

    Description

    Options

    url

    string | null

    null

    URL to fetch items from (optional)

    Load Items with Default Model URLs

    Option

    Type

    Default

    Description

    Options

    dataModel

    string | null

    null

    The SM model to use to populate the field list

    "cycle", "downtime", "kpi", "part"

    fieldType

    array

    ["continuous", "categorical"]

    The field types to include

    "continuous", "categorical", "discrete", "datetime"

    Data Model Picker + Asset Picker Example:

    When both a data model picker and an asset picker are included in the picker list, the multi-field picker will handle populating the items for you based on the selected model and asset.

    {
      "type": "multi-field",
      "showSelectNone": true,
      "fullItem": true,
      "fieldTypes": ["categorical", "continuous"]
    }

    Asset Picker Example:

    In situations where only a single data model is needed, you can add dataModel to the picker to specify the model the items should load from. Note: The above method will override this if a data model picker exists.

    {
      "type": "multi-field",
      "fullItem": true,
      "dataModel": "downtime"
    }

    URL Example:

    You can also specify a specific url to load the item from. Note the url response item should include name, display_name.

    For even more flexibility, consider using the multi-choice picker. Note: fieldType doesn't work with the url method.

    {
      "type": "multi-field",
      "showSelectNone": true,
      "fullItem": true,
      "url": "/v1/selector/analytics/cycle/${getAssetType(asset)}/axis?stat_type=continuous,discrete&fixed_stat_type="
    }

    Default Query Params

    The multi-field picker generates a list of selected fields each with these following important params to the API Query:

    Parameter

    Type

    Description

    id

    string

    selected item id

    title

    string

    selected item title

    Other field information may be included.

    Example request body with fullItem: true:

     "multi-field-1": {
      "pickerType": "field",
      "value": [{
        "unit": "",
        "type": "categorical",
        "data_type": "string",
        "stream_types": [],
        "raw_data_field": "",
        "model": "cycle",
        "id": "shift",
        "title": "Shift"
     }]
    }

    Example request body with fullItem: false:

    "multi-field-1": {
      "pickerType": "field",
      "value": ["shift"]
    }

    Page Link

    Example mapping for page link.

    Assigning the field with field ids.

    {
        "mapping": {
            'multi-field': '["shift", "stats__custom_field__val"]'
        }
    }