SharePoint column formatting

SharePoint Yes/No column formatting

SharePoint's default Yes/No column renders as a tiny checkbox icon that's easy to miss when scanning a list. Column formatting JSON turns it into a clear toggle switch or checkbox instead.

A Yes/No (boolean) column stores true or false, but by default SharePoint just shows a small checked or unchecked box — no color, no label. With column formatting JSON, you can render it as a colored toggle switch, a checkbox with a strikethrough label, or any other visual you want.

Before and after

TaskDone
Submit budget
Review draft
Plan offsite
Green + right = Yes · grey + left = No
Build this Yes/No toggle → Opens the step-by-step guide with the Yes/No switch already picked. A checkbox-style design is also available.

What the SharePoint Yes/No JSON looks like

The generator produces JSON like the example below. The field's boolean value drives both the switch position and its color:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "width": "34px", "height": "18px", "border-radius": "20px",
    "background-color": "=if([$Done] == 1, '#107c10', '#c8c6c4')",
    "position": "relative"
  },
  "children": [
    {
      "elmType": "div",
      "style": {
        "width": "14px", "height": "14px", "border-radius": "50%", "background-color": "white",
        "position": "absolute", "top": "2px",
        "left": "=if([$Done] == 1, '18px', '2px')"
      }
    }
  ]
}

This is standard SharePoint boolean column formatting JSON: the field value (1 for Yes, 0 for No) is checked with if() to set both color and knob position. The generator writes this — and the click-to-edit behavior — for you.

How to apply it

The step-by-step guide spells out every click, with pictures. In short:

  1. Click Build this Yes/No toggle above. It opens the step-by-step guide with the Yes/No switch design already picked. For a to-do list look, use Checkbox To-Do instead.
  2. In step 2, type your Yes/No column’s name. (Checkbox To-Do also lets you pick the Done color.)
  3. No Yes/No column yet? Step 3 shows exactly how to add one.
  4. Click Copy my code.
  5. In your list, click the name at the top of your column, then Column settings, then Format this column. At the bottom of the panel that opens, click Advanced mode.
  6. Click inside the box, press Ctrl+A and then Delete to empty it, and press Ctrl+V to paste. Click Preview, then Save.
Most common reason it doesn't work: the name you type has to match the name your list stores for the column, which can differ from the name you see. Step 2 of the guide shows how to check it, or see how to find your column’s exact name.

Common questions

What column type do I need for a Yes/No toggle?
A Yes/No (boolean) column. SharePoint stores it as true/false internally, which the JSON checks with a simple condition.
Can people still click to change the value?
Yes — the toggle and checkbox templates are click-to-edit, so clicking the cell flips the value directly in list view without opening the item.
Toggle switch or checkbox — which should I use?
Use a toggle for flags like Active/Archived or Approved/Not Approved. Use the checkbox-style template for to-do or completion lists, since it shows a strikethrough label when checked.