Learn how to filter by, read, update, and clear the hour column on monday boards using the platform API
The hour column contains a specific time value in HH:MM format.
Via the API, the hour column supports read, filter, update, and clear operations.
Column Type | Implementation Type | Supported Operations |
|---|---|---|
|
|
|
Queries
Hour columns can be queried through the column_values field on items queries using an inline fragment on HourValue.
query {
items(ids: [1234567890, 9876543210]) {
column_values {
... on HourValue {
hour
minute
}
}
}
}import { ApiClient } from "@mondaydotcomorg/api";
const mondayApiClient = new ApiClient({ token: myToken });
const query = `
query($itemIds: [ID!], $columnType: [ColumnType!]) {
items(ids: $itemIds) {
id
column_values(types: $columnType) {
column { title id }
... on HourValue {
hour
minute
}
}
}
}
`;
const variables = {
itemIds: [9571351485, 9572374902],
columnType: "hour"
};
const response = await mondayApiClient.request(query, variables);Fields
You can use the following fields to specify what information your HourValue implementation will return.
| Field | Description |
|---|---|
column Column! | The column the value belongs to. |
hour Int | The column's hour value. |
id ID! | The column's unique identifier. |
minute Int | The column's minute value. |
text String | The column's value as text. Returns "" if the column has an empty value. |
type ColumnType! | The column's type. |
updated_at Date | The column's last updated date. |
value JSON | The column's JSON-formatted raw value. |
Filter
You can filter items by hour values using the items_page object. The hour column supports the following operators:
Operators | Compare Values |
|---|---|
|
|
|
|
|
|
|
|
Compare values
Hour column filters use predefined time ranges aligned with the UI. These values depend on the user's timezone settings when making the API call.
Early morning: 4:00 - 7:00 AMMorning: 7:00 AM - 12:00 PMAfternoon: 12:00 - 8:00 PMEvening: 8:00 - 11:00 PMNight: 11:00 PM - 4:00 AM
Example
The following query returns items with an hour column value in the Afternoon range:
query {
boards(ids: 1234567890) {
items_page(
query_params: {
rules: [
{
column_id: "hour"
compare_value: ["Afternoon"]
operator: any_of
}
]
}
) {
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: "hour_mksvv75n",
compareValue: ["Afternoon"],
operator: "any_of"
};
const response = await mondayApiClient.request(query, variables);Mutations
Update
You can update an hour column using change_multiple_column_values by passing a JSON object containing the hour and minute values in 24-hour time without leading zeroes (e.g., use 9, not 09).
mutation {
change_multiple_column_values(
item_id: 9876543210
board_id: 1234567890
column_values: "{\"hour\": {\"hour\": 16, \"minute\": 42}}"
) {
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({
hour_mksvv75n: {
hour: 20,
minute: 20
}
})
};
const response = await mondayApiClient.request(query, variables);Clear
You can clear an hour column using change_multiple_column_values by passing null or an empty object in column_values.
mutation {
change_multiple_column_values(
item_id: 9876543210
board_id: 1234567890
column_values: "{\"hour\": 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({
hour_mksvv75n: null
})
};
const response = await mondayApiClient.request(query, variables);