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.
The Boolean field captures a yes/no, on/off, true/false decision. It renders as a
single checkbox by default. Seven styles are available via renderStyle,
and every one of them except that lone checkbox lets you name the two states
yourself, so a field can read "Approved / Rejected" instead of "Yes / No".
It binds to SharePoint's Boolean column (a.k.a. Yes/No).
Common properties
| Property | Description |
|---|---|
labelstring | The field label. It follows the same Label position, Label width and Control width settings as every other field: above the control by default, or inline left, inline right, or hidden. For the conventional "checkbox with text beside it" look, use inlineLabel below. |
descriptionstring | Helper text. |
requiredboolean default: false | Blocks submit until the user answers, on the styles that can start blank (checkboxes, radio, dropdown, buttons, cards). A single checkbox or a toggle has no blank state, so an unticked box counts as "No" and Required only draws the star there. To force a Yes, add a Custom validation rule (see below). |
readOnlyboolean default: false | Disables editing. |
Type-specific properties
| Property | Description |
|---|---|
renderStyle"checkbox" · "checkboxes" · "radio" · "toggle" · "dropdown" · "buttons" · "fancy" default: "checkbox" | checkbox: one tick box, captioned by inlineLabel. checkboxes: two square boxes, Yes and No, pick one. radio: the same pair with round controls. toggle: a real switch (track and sliding knob). dropdown: a select that starts blank. buttons: a connected segmented pair. fancy: two big tappable cards. Everything except the lone checkbox starts with nothing selected, so Required can block submit on those. |
inlineLabelstring | Optional caption drawn directly beside the box, e.g. "I agree to the terms". Separate from the field label, and used only by the checkbox and toggle styles (the others label themselves from trueLabel / falseLabel). Leave it blank to show just the control. |
trueLabelstring default: "Yes" | Your wording for the TRUE state, used by every style that shows both: checkboxes, radio, dropdown, buttons and cards. On the toggle it is the caption shown while the switch is on. It also names the value in read-only and Display-form renders, and in the quiz answer key. |
falseLabelstring default: "No" | Your wording for the FALSE state, in the same places. This is the field’s VALUE text, not its label: the label lives in the Style tab with every other field’s. |
defaultValueboolean | Initial state on a new form. With no default, a checkbox or toggle starts unticked (No) and every other style starts blank. |
JavaScript recipes
Read the value
const agreed = f365.field('AgreedToTerms').value === true;
Block submit when the consent box is unticked
f365.events.onBeforeSave(() => {
if (f365.field('AgreedToTerms').value !== true) {
f365.ui.showAlert('You must accept the terms before submitting.');
return { cancel: true };
}
});
Unlock dependent fields when set
f365.events.onChange('IsCompany', (v) => {
f365.field('CompanyABN').visible = v === true;
f365.field('CompanyABN').required = v === true;
});
Related
Related articles
- Choice field
Single-select from a fixed list of options, rendered as a dropdown, a radio group, or compact pills.