- Print
- DarkLight
Multi-Field Picker
- Print
- DarkLight
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 |
|---|---|---|---|---|
| boolean | false | When | |
| boolean | false | Determines if the selected list of items is sortable | |
| number | 0 | Number of items selected by default | |
| number | null | Maximum number of items that can be picked | |
| boolean | false | Selects all items by default if | |
| boolean | false | Disables the apply button when no items are selected | |
| array | [] | Default list of IDs of the picked items (optional) | |
| boolean | false | When |
Load Items with URL (for specific list)
Option | Type | Default | Description | Options |
|---|---|---|---|---|
| string | null | null | URL to fetch items from (optional) |
Load Items with Default Model URLs
Option | Type | Default | Description | Options |
|---|---|---|---|---|
| string | null | null | The SM model to use to populate the field list |
|
| array | ["continuous", "categorical"] | The field types to include |
|
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 |
|---|---|---|
| string | selected item id |
| 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"]'
}
}