Learn how to filter by and read the last updated column on monday boards using the platform API
The last updated column represents when an item was last updated. You can filter by and read the last updated column via the API, but you currently cannot update or clear it.
Filter by the last updated column
Using the items_page
object, you can easily filter a board's items by specific columns or column values.
The last updated column is unique in that you don't actually need the column on your board to filter results by its data. You can do so by sending "__last_updated__"
as the column_id
and creating the other rules as you normally would (see example below).
Whether or not you actually have the column on the board, you can filter the last updated column by the user who last updated an item or the date it was last updated. It's important to note that the results are based on the timezone, date, and week settings configured in the monday.com profile of the user who made the call.
The table below contains the last updated column's supported operators, compare values, and compare attributes.
Operators | Compare values | Compare attributes |
---|---|---|
any_of | "assigned_to_me" (items last updated by the user who made the call, no compare attribute required)"person-123456" (items last updated by the specified user, no compare attribute required)"TODAY" "YESTERDAY" "THIS_WEEK" "LAST_WEEK" "THIS_MONTH" "LAST_MONTH" "PAST_DATETIME" (returns all items) | "UPDATED_AT" |
not_any_of | "assigned_to_me" (items that were not last updated by the user who made the API call, no compare attribute required)"person-123456" (items that were not last updated by the specified user, no compare attribute required)"TODAY" "YESTERDAY" "THIS_WEEK" "LAST_WEEK" "THIS_MONTH" "LAST_MONTH" | "UPDATED_AT" |
Examples
The following example returns all items on the specified board that were last updated on today's date, even though there is no last updated column on the board.
query {
boards(ids: 1234567890) {
items_page (query_params: {rules: [{column_id: "__last_updated__", compare_value: ["TODAY"], operator:any_of, compare_attribute:"UPDATED_AT"}]}) {
items {
id
name
}
}
}
}
The following example returns all items on the specified board that were last updated by user 123456.
query {
boards (ids: 1234567890) {
items_page (query_params: {rules: [{column_id: "last_updated", compare_value: ["person-123456"], operator:any_of}]}) {
items {
id
name
}
}
}
}
Read the last updated column
You can query the last updated column using the column_values
object that enables you to return column-specific subfields by sending a fragment in your query. Values for the last updated column are of the LastUpdatedValue
type.
query {
items (ids:[1234567890, 9876543210]) {
column_values {
... on LastUpdatedValue {
updated_at
value
}
}
}
}
Fields
Field | Description |
---|---|
column Column! | The column the value belongs to. |
id ID! | The column's unique identifier. |
text String | The column's value as text. |
type ColumnType! | The column's type. |
updated_at Date | The column's last updated date. |
updater User! | The user who last updated the item. |
updater_id ID! | The unique identifier of the user who last updated the item. |
value JSON | The column's JSON-formatted raw value. |
Join our developer community!
We've created a community specifically for our devs where you can search through previous topics to find solutions, ask new questions, hear about new features and updates, and learn tips and tricks from other devs. Come join in on the fun! 😎