Field Service Mobile Element Select Options
Select and multi-select mobile elements present a list of options in the Field Service Management (FSM) Mobile app. Configure the options property to define the available options.
This topic includes the following information about configuring options for select and multiselect mobile elements:
Options Property Reference
Use the options property to define the list of options for a select element. Each option includes an id and a label property. The following sections explain default selections, search-generated options, and additional option properties.
Select Option ID and Label Properties
The options property accepts an of options. Each option includes an id property and a label property.
Use the following format to configure options for a select element:
"options": [{
"id": "1",
"label": "Option 1"
},{
"id": "2",
"label": "Option 2"
},{
"id": "3",
"label": "Option 3"
}]
Setting Default Select Options
To set a default option, add a selected property to the option. If multiple options have a selected property, the option with the lowest selected property value becomes the default. In the following example, Apple is the default option:
"options": [{
"id": "333",
"label": "Banana",
"selected": "3"
},{
"id": "555",
"label": "Apple",
"selected": "1"
},{
"id": "777",
"label": "Orange",
"selected": "2"
},{
"id": "999",
"label": "Mango"
}]
The selected property is optional. Among the options that include this property, the option with the lowest selected value becomes the default.
The selected property is useful when a search generates the option list. The following example uses results from the custrecord_nx_case_type search as select-field options:
"options": {
"record": "customrecord_nx_case_type",
"filters": ["isinactive","is","F"],
"map": {
"id": "internalid",
"label": "name",
"selected": "formulatext: CASE WHEN {internalid} IN (1) THEN '1' WHEN {internalid} IN (3) THEN '2' END"
}
}
The formula selects the case type with internal ID 1 when the search returns it. Otherwise, it selects the case type with internal ID 3. If the search returns neither case type, no default option is selected.
Additional Select Option Properties
You can add other properties to the options in a select field. The current element's search function also searches additional option properties. It compares search terms with the id, label, and additional property values.
"options": [{
"id": "1",
"label": "Option 1",
"altname": "opt1"
},{
"id": "2",
"label": "Option 2",
"altname": "opt2"
},{
"id": "3",
"label": "Option 3",
"altname": "opt3"
}]
You can search for these options by using the alternate names opt1, opt2, and opt3. The option labels don't display these names.
When you select a value in a mobile element, FSM copies only the id and label properties to the element's value property. To retrieve another property, use a dynamic expression that matches the selected ID with an option in the list.
In the following example, the selectedunitcode property retrieves the unitcode property of the selected option.
"selectelement1": {
"type": "select",
"label": "Select Element 1",
"options": [{
"id": "1",
"label": "Option 1",
"unitcode": "555"
},{
"id": "2",
"label": "Option 2",
"unitcode": "777"
},{
"id": "3",
"label": "Option 3",
"unitcode": "999"
}],
"selectedunitcode": "selectelement1.value && selectelement1.options.find(o => o.id == selectelement1.value.id).unitcode"
}