Field controlsModel-driven app

Yes/No

A two-option column that can be shown as a toggle, a checkbox or a dropdown, with your own labels for each option.

Show me in the demoOpens the demo app with this component highlighted.

What it is

A Yes/No column (also called two options) stores true or false. On a form the user flips it with a toggle, ticks it as a checkbox, or picks a value from a dropdown, depending on how the column and the form are set up.

Each of the two options has its own label. The labels are what people read in forms, views and charts, so they can say "Confidential" and "Public" rather than Yes and No.

When to use it

Use it for a real boolean, such as "Is confidential" or "Is highlighted", where no third state is needed.

If you might add a third answer later, or you need an unknown state, start with a Choice column. A two-option column cannot be extended without changing the data type. For a different look on the same data, see Toggle switch.

Licensing and configuration

No extra licence. Create the column in the table designer (data type Yes/No), set the option labels and the default value, then add it to the form in the form designer. Pick the display style on the form field or add a control with + Component.

Pitfalls

  • Labels are stored per column and are localised through translations. If you change them later, update charts, views and documentation that quote the old text.
  • A default value applies to new records only. Existing records keep their value.
  • A checkbox cannot show "not set", so a new record looks the same as an explicit No unless the column has a default.
  • Business rules that test "equals Yes" read the underlying value, not the label.

Try it in the demo

  1. Open the first accelerator and find the Yes/No fields in the Controls tab.
  2. Switch the toggle for Is confidential and note the label next to it.
  3. Tick and untick the checkbox for Is highlighted. Both are the same kind of column.
  4. Save with Ctrl+S.