MultiChoice field
Pick multiple values from a fixed list, checkbox group, pill toggles, or multi-select dropdown.
The MultiChoice field lets the user pick any number of values from a fixed list.
Binds to SharePoint's MultiChoice column type. The value is read and written as a
string array.
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[] default: ['Option 1', 'Option 2', 'Option 3'] | The selectable values. Inherited from the SP column choices. |
displayMode'checkbox' | 'dropdown' default: 'checkbox' | Render as a checkbox group (checkbox) or a multi-select combobox (dropdown). |
minAnswersnumber | Minimum number of options that must be selected. |
maxAnswersnumber | Maximum number of options that may be selected. |
answerCountMessagestring | Validation message shown when minAnswers / maxAnswers fails. |
fancyCardsboolean default: false | Render options as large tappable "fancy cards". Presentation only; mutually exclusive with largeControls. |
largeControlsboolean default: false | Render checkboxes as large custom-drawn controls for easier tapping. Mutually exclusive with fancyCards. |
columnsLayoutnumber (1-6) | Number of columns the options lay into. Ignored in dropdown mode. |
optionGapnumber (px) | Space between options. Ignored in dropdown mode. |
JavaScript recipes
Read and set the selected values
const selected = f365.field('Toppings').value as string[];
// Set the selection:
f365.field('Toppings').value = ['Cheese', 'Mushroom'];
Enforce a selection count
f365.events.onValidate((errs) => {
const picks = (f365.field('Toppings').value as string[]) ?? [];
if (picks.length > 3) {
errs.add('Toppings', 'Pick at most three toppings.');
}
});
Reveal a follow-up field when an option is picked
f365.events.onChange((e) => {
if (e.fieldKey !== 'Toppings') return;
const picks = (e.newValue as string[]) ?? [];
f365.field('OtherTopping').visible = picks.includes('Other');
});
Warn when a conflicting pair is selected
f365.events.onChange((e) => {
if (e.fieldKey !== 'Days') return;
const picks = (e.newValue as string[]) ?? [];
if (picks.includes('Weekdays') && picks.includes('Weekends')) {
f365.ui.showToast('Pick either Weekdays or Weekends, not both.', 'error');
}
});
Related
Related articles
- Choice field
Single-select from a fixed list of options, rendered as a dropdown, a radio group, or compact pills.
- Taxonomy field
Pick from a SharePoint Managed Metadata term set, single or multi-level, single or multi-select.