Choice field
Single-select from a fixed list of options, rendered as a dropdown, a radio group, or compact pills.
The Choice field lets the user pick exactly one value from a fixed list. The same field can render three ways, dropdown, radio group, or pill group, chosen via the
renderAs property.
It binds to SharePoint's Choice column type. Options are read from the column's
choice list at form load and stay in sync via schema reconciliation.
Common properties
| Property | Description |
|---|---|
labelstring | Visible label. |
descriptionstring | Helper text. |
requiredboolean default: false | Marks the field required. |
readOnlyboolean default: false | Disables editing. |
Type-specific properties
| Property | Description |
|---|---|
optionsstring[] | {label, value, color?}[] | Authoring override of the SP choice list. Omit to inherit from the SharePoint column. |
renderAs"dropdown" | "radio" | "pills" default: "dropdown" | Visual treatment. Use radio for ≤5 options, dropdown for 6+. |
allowFillInboolean default: inherited from column | Allow the user to type a custom value not in the list. |
defaultValuestring | Selected on a new form. |
JavaScript recipes
Read the selected value
const status = f365.field('Status').value as string | null;
Override the options list dynamically
f365.events.onLoad(async () => {
const allowed = await f365.http.get<string[]>('/api/allowed-statuses');
f365.field('Status').options = allowed;
});
Cascade: show a field only for a specific choice
f365.events.onChange('Department', (v) => {
f365.field('CostCenter').visible = v === 'Finance';
f365.field('CostCenter').required = v === 'Finance';
});
Colour-code values
// In the property panel:
f365.field('Status').options = [
{ label: 'Open', value: 'Open', color: '#22c55e' },
{ label: 'Blocked', value: 'Blocked', color: '#e53935' },
{ label: 'Done', value: 'Done', color: '#6b7280' },
];
Related
Related articles
- MultiChoice field
Pick multiple values from a fixed list, checkbox group, pill toggles, or multi-select dropdown.
- Boolean field (Yes/No)
Seven ways to render a SharePoint Yes/No column: tick box, two boxes, radio pair, switch, dropdown, segmented buttons or cards, with your own wording.