Learn how to filter, read, update, and clear the checkbox column on monday boards using the platform API
The checkbox column represents a simple true or false value on a board.
Via the API, the checkbox column supports read, filter, update, and clear operations.
Column Type | Implementation Type | Supported Operations |
|---|---|---|
|
|
|
Queries
Checkbox columns can be queried through the column_values field on items queries using an inline fragment on CheckboxValue.
query {
items(ids: [1234567890, 9876543210]) {
column_values {
... on CheckboxValue {
checked
updated_at
}
}
}
}import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });
const query = `
query($itemIds: [ID!]) {
items(ids: $itemIds) {
column_values {
... on CheckboxValue {
checked
updated_at
}
}
}
}
`;
const variables = { itemIds: [9571351485, 9572374902] };
const response = await mondayApiClient.request(query, variables);Fields
You can use the following fields to specify what information your CheckboxValue implementation will return.
| Field | Description |
|---|---|
checked Boolean | Whether the column is checked. |
column Column! | The column the value belongs to. |
id ID! | The column's unique identifier. |
text String | The column value as text. Returns "" if the column has no value. |
type ColumnType! | The column's type. |
updated_at Date | The column's last updated date. |
value JSON | The raw JSON-formatted column value. |
Filter
You can filter items by checkbox values using the items_page object. The checkbox column supports the following operators:
| Operators | Compare Values |
|---|---|
is_empty | [] |
is_not_empty | [] |
Checkbox column filters only use an empty array as the compare value because the checkbox stores either a value or no value.
Example
The following query returns all items with an unchecked checkbox:
query {
boards(ids: 1234567890) {
items_page(
query_params: {
rules: [
{
column_id: "check"
compare_value: []
operator: is_empty
}
]
}
) {
items {
id
name
}
}
}
}import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });
const query = `
query ($boardId: [ID!], $columnId: ID!, $operator: ItemsQueryRuleOperator!, $compareValue: CompareValue!) {
boards(ids: $boardId) {
items_page(
query_params: {
rules: [
{ column_id: $columnId, compare_value: $compareValue, operator: $operator }
]
}
) {
items {
id
name
}
}
}
}
`;
const variables = {
boardId: 9571351437,
columnId: "boolean_mksrnay",
compareValue: [null],
operator: "is_empty",
};
const response = await mondayApiClient.request(query, variables);Mutations
Update
You can update a checkbox column using change_multiple_column_values by passing a JSON object in column_values.
To check the box, send:
{"checked": "true"}mutation {
change_multiple_column_values(
item_id: 1234567890
board_id: 9876543210
column_values: "{\"checkbox\": {\"checked\": \"true\"}}"
) {
id
}
}import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });
const query = `
mutation ($boardId: ID!, $itemId: ID!, $columnValues: JSON!) {
change_multiple_column_values(
item_id: $itemId
board_id: $boardId
column_values: $columnValues
) {
id
}
}
`;
const variables = {
boardId: 9571351437,
itemId: 9571351485,
columnValues: JSON.stringify({
boolean_mksrnay: { checked: true } // column ID
})
};
const response = await mondayApiClient.request(query, variables);Clear
You can clear (uncheck) a checkbox column using change_multiple_column_values by passing null in column_values.
mutation {
change_multiple_column_values(
item_id: 9876543210
board_id: 1234567890
column_values: "{\"checkbox\": null}"
) {
id
}
}import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });
const query = `
mutation ($boardId: ID!, $itemId: ID!, $columnValues: JSON!) {
change_multiple_column_values(
item_id: $itemId
board_id: $boardId
column_values: $columnValues
) {
id
}
}
`;
const variables = {
boardId: 9571351437,
itemId: 9571351485,
columnValues: JSON.stringify({
checkbox_id123: null // replace with your column ID
})
};
const response = await mondayApiClient.request(query, variables);