Learn how to filter by, read, update, and clear the timeline column on monday boards using the platform API
The timeline column contains a range of dates. This is useful should your item(s) require more than a single date to be stored. The API allows you to read, filter, update, and clear the timeline column.
Read a timeline column
You can query the timeline column using the column_values object that enables you to return column-specific subfields by sending a fragment in your query. Values for the timeline column are of the TimelineValue type.
query {
items (ids:[1234567890, 9876543210]) {
column_values {
... on TimelineValue {
from
to
}
}
}
}Fields
| Field | Description |
|---|---|
column Column! | The column the value belongs to. |
from Date | The timeline's start date. |
id ID! | The column's unique identifier. |
text String | The timeline's date range in YYYY-MM-DD format. This field will return "" if the column has an empty value. |
to Date | The timeline's end date. |
type ColumnType! | The column's type. |
updated_at Date | The column's last updated date. |
value JSON | The column's JSON-formatted raw value. |
visualization_string String | The timeline's visualization type. |
Filter a timeline column
Using the items_page object, you can easily filter a board's items by specific columns or column values. The table below contains the timeline column's supported operators, compare values, and compare attributes.
| Operators | Compare Values | Compare Attributes |
|---|---|---|
any_of | "CURRENT", "DUE_TODAY", "FUTURE_TIMELINE", "PAST_TIMELINE", "DONE_ON_TIME", "OVERDUE", "DONE_OVERDUE", "MILESTONE", "$$$blank$$$" | |
not_any_of | "CURRENT", "DUE_TODAY", "FUTURE_TIMELINE", "PAST_TIMELINE", "DONE_ON_TIME", "OVERDUE", "DONE_OVERDUE", "MILESTONE", "$$$blank$$$" | |
is_empty | [] | |
is_not_empty | [] | |
greater_than | "TODAY", "TOMORROW", "YESTERDAY", "THIS_WEEK", "ONE_WEEK_AGO", "ONE_WEEK_FROM_NOW", "THIS_MONTH", "ONE_MONTH_AGO", "ONE_MONTH_FROM_NOW", "PAST_DATETIME", "FUTURE_DATETIME", "UPCOMING", "OVERDUE", "DONE_ON_TIME", "DONE_OVERDUE", "EXACT" | "START_DATE", "END_DATE" |
greater_than_or_equals | "TODAY", "TOMORROW", "YESTERDAY", "THIS_WEEK", "ONE_WEEK_AGO", "ONE_WEEK_FROM_NOW", "THIS_MONTH", "ONE_MONTH_AGO", "ONE_MONTH_FROM_NOW", "PAST_DATETIME", "FUTURE_DATETIME", "UPCOMING", "OVERDUE", "DONE_ON_TIME", "DONE_OVERDUE", "EXACT" | "START_DATE", "END_DATE" |
lower_than | "TODAY", "TOMORROW", "YESTERDAY", "THIS_WEEK", "ONE_WEEK_AGO", "ONE_WEEK_FROM_NOW", "THIS_MONTH", "ONE_MONTH_AGO", "ONE_MONTH_FROM_NOW", "PAST_DATETIME", "FUTURE_DATETIME", "UPCOMING", "OVERDUE", "DONE_ON_TIME", "DONE_OVERDUE", "EXACT" | "START_DATE", "END_DATE" |
lower_than_or_equal | "TODAY", "TOMORROW", "YESTERDAY", "THIS_WEEK", "ONE_WEEK_AGO", "ONE_WEEK_FROM_NOW", "THIS_MONTH", "ONE_MONTH_AGO", "ONE_MONTH_FROM_NOW", "PAST_DATETIME", "FUTURE_DATETIME", "UPCOMING", "OVERDUE", "DONE_ON_TIME", "DONE_OVERDUE", "EXACT" | "START_DATE", "END_DATE" |
between | "TODAY", "TOMORROW", "YESTERDAY", "THIS_WEEK", "ONE_WEEK_AGO", "ONE_WEEK_FROM_NOW", "THIS_MONTH", "ONE_MONTH_AGO", "ONE_MONTH_FROM_NOW", "PAST_DATETIME", "FUTURE_DATETIME", "UPCOMING", "OVERDUE", "DONE_ON_TIME", "DONE_OVERDUE", "EXACT" | "START_DATE", "END_DATE" |
Examples
The following example returns all items on the specified board with a timeline column end date of the current week, or later.
query {
boards(ids: 1234567890) {
items_page(query_params: {
rules: [
{
column_id: "timeline"
compare_value:"THIS_WEEK"
compare_attribute: "END_DATE"
operator:greater_than_or_equals
}
]
}
) {
items {
id
}
}
}
}The following examples returns all items on the specified board with a timeline column start date of March 1st, 2024, or earlier.
query {
boards(ids: 1234567890) {
items_page(
query_params: {
rules: [
{
column_id: "timeline"
compare_value: ["EXACT","2024-03-01"]
compare_attribute: "START_DATE"
operator: lower_than_or_equal
}
]
}
) {
items {
id
}
}
}
}Update a timeline column
You can update a timeline column using the change_multiple_column_values mutation and passing a JSON string in the column_values argument. Simple string updates are not supported.
JSON
To update a timeline column using JSON, send the start and end dates in a YYYY-MM-DD format. The start date is “from” and the end date is “to”.
mutation {
change_multiple_column_values(
item_id:9876543210
board_id:1234567890
column_values: "{\"timeline\" : {\"from\" : \"2019-06-03\", \"to\" : \"2019-06-07\"}}"
) {
id
}
}Clear a timeline column
You can also clear a timeline column using the change_multiple_column_values mutation and passing null or an empty object in the column_values argument.
mutation {
change_multiple_column_values(
item_id:9876543210
board_id:1234567890
column_values: "{\"timeline\" : null}"
) {
id
}
}