Learn how to filter by and read the last updated column on monday boards using the platform API
The last updated column displays when an item was last modified and who updated it.
Via the API, the last updated column supports read and filter operations.
Column Type | Implementation Type | Supported Operations |
|---|---|---|
|
|
|
Queries
Last updated columns can be queried through the column_values field on items queries using an inline fragment on LastUpdatedValue.
query {
items(ids: [1234567890, 9876543210]) {
column_values {
... on LastUpdatedValue {
updated_at
value
}
}
}
}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 LastUpdatedValue {
updated_at
updater_id
}
}
}
}
`;
const variables = {
itemIds: [9571351485, 9572374902],
columnType: "last_updated"
};
const response = await mondayApiClient.request(query, variables);Fields
You can use the following fields to specify what information your LastUpdatedValue implementation will return.
| 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. |
Filter
You can filter items by their last updated information using the items_page object.
Even if the last updated column is not visible on the board, you can filter by last updated metadata using __last_updated__ as the column_id.
You can filter items by:
- Who last updated them
- When they were last updated
The results depend on the timezone, date format, and first day of the week settings configured in the monday.com profile of the user making the API call.
Compare Value | Description | Operators | Compare Attribute | Compare Attribute Required? |
|---|---|---|---|---|
| Items last updated by the calling user |
| No | |
| Items last updated by a specific user |
| No | |
| Items last updated today |
|
| Yes |
| Items last updated yesterday |
|
| Yes |
| Items last updated this week |
|
| Yes |
| Items last updated last week |
|
| Yes |
| Items last updated this month |
|
| Yes |
| Items last updated last month |
|
| Yes |
| Items last updated in the past |
|
| Yes |
Examples
Filter by today's updates
This example returns all items last updated today, even if the board does not have a visible last updated column.
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
}
}
}
}const query = `
query ($boardId: [ID!], $columnId: ID!, $operator: ItemsQueryRuleOperator!, $compareValue: CompareValue!, $compareAttribute: String!) {
boards(ids: $boardId) {
items_page(
query_params: {
rules: [
{
column_id: $columnId,
compare_value: $compareValue,
compare_attribute: $compareAttribute,
operator: $operator
}
]
}
) {
items { id name }
}
}
}
`;
const variables = {
boardId: 9571351437,
columnId: "__last_updated__",
compareValue: ["TODAY"],
compareAttribute: "UPDATED_AT",
operator: "any_of"
};
const response = await mondayApiClient.request(query, variables);Filter by who last updated an item
This example returns all items 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
}
}
}
}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: "__last_updated__",
compareValue: ["person-123456"],
operator: "any_of"
};
const response = await mondayApiClient.request(query, variables);