Choices and available values
The fields of an available value record, how value groups share one choice list between fields, and the shipped priority values as an example.
This page describes how a choice field stores its options, for administrators and developers who maintain choice lists. Each option is an available value record, which you usually edit from the form rather than directly.
How choices are stored
A choice field lets users pick from a fixed list of values without referencing another table. Each option is a record in the Available value table, under Application → Field → Available values. When you add, change or remove a choice from a form, Servicely creates, updates or deletes these records for you. Labels are localised, and one group of values can serve several fields on several tables.
Only administrators can change choices. See Edit a field’s choices for the steps.
Available value fields
| Field | Type | Example | What it holds |
|---|---|---|---|
| Table | Table | Incident | The table on which the value appears as a choice. |
| Field | Field | Impact | The field on that table on which the value appears. |
| Key | String | high |
The stored value. Scripts and queries use the key, not the label. Use letters, numbers and underscores only. The key need not match the label. |
| Label | Localized text | High | The text users see. It can differ per language. |
| Group | String | IncidentImpact |
The value group the value belongs to. A group ties a set of values to a field, and lets several fields share the set. |
| Value type | Choice | Standard | Standard or Group. Group marks values kept for reuse across several choice fields. |
| Order | Integer | 100 | The position of the value in the list, lowest first. Only the relative order matters, so 1 and 2 sort the same as 100 and 2500. The default is 100. |
| Active | Boolean | Yes | Whether users can pick the value. Deactivate a value you no longer need instead of deleting it, so records that hold it keep their label. |
| Qualifier | String | issue |
Shows the value only when another field holds this key or record ID. See Make a choice field depend on another field. |
| Icon | String | Forward to Inbox | An icon shown with the value. |
| Styles | Multiple reference | status dot, status dot red | Named styles applied to the value. |
| CSS | String | .ns-status-dot-amber |
A CSS class, from the system or a style sheet, applied to the value. |
Example: shipped priority values
The Priority field of ITSM work records shows how key, label, group and order work together. Incident, request, change and problem records all inherit these values.
| Key | Label | Group | Order |
|---|---|---|---|
1 |
P1 | Critical | ITSMWorkPriority |
100 |
2 |
P2 | High | ITSMWorkPriority |
200 |
3 |
P3 | Medium | ITSMWorkPriority |
300 |
4 |
P4 | Low | ITSMWorkPriority |
400 |
5 |
P5 | Planning | ITSMWorkPriority |
500 |
A script that sets priority to P2 sets the key 2.
Field properties for shared groups
To give a field the values of an existing group, add these properties to the field definition. Many platform fields share the TimeZone group this way, among them the time zone fields on User and Location.
| Property | Example | What it does |
|---|---|---|
available_value.group |
TimeZone |
Names the value group the field takes its choices from. |
available_value.type |
group |
Tells the field to use the named group. |
Choices on a child table
A field defined on a parent table can have different choices on a child table. Priority is defined on ITSM work, so a child such as Incident could carry its own list. The child’s values are available value records whose Table is the child table. You create them from the field definition of the child. See Edit a field’s choices.