Learn how to filter, read, update, and clear the dependency column on monday boards using the platform API
The dependency column allows you to set up item-to-item dependencies within the same board. These dependencies can be visualized in Gantt views, used in automations, and combined with timeline and date logic.
Via the API, the dependency column supports read, filter, update, and clear operations.
Column Type | Implementation Type | Supported Operations |
|---|---|---|
|
|
|
Queries
Dependency columns can be queried through the column_values field on items queries using an inline fragment on DependencyValue.
query {
items(ids: [1234567890, 9876543210]) {
column_values(types: dependency) {
... on DependencyValue {
linked_item_ids
linked_items {
id
}
}
}
}
}const query = `
query($itemIds: [ID!], $columnType: [ColumnType!]) {
items(ids: $itemIds) {
id
column_values(types: $columnType) {
column { title id }
... on DependencyValue {
linked_item_ids
}
}
}
}
`;
const variables = {
itemIds: [9571351485, 9572374902],
columnType: "dependency",
};
const response = await mondayApiClient.request(query, variables);Fields
You can use the following fields to specify what information your DependencyValue implementation will return.
| Field | Description |
|---|---|
column Column! | The column the value belongs to. |
display_value String! | The names of dependent items, separated by commas. |
id ID! | The dependency column's unique identifier. |
linked_item_ids [ID!]! | The unique identifiers of the items this item depends on. |
linked_items [Item!]! | The dependent items. |
text String | Always return null. Use display_value instead. |
type ColumnType! | The column's type. |
updated_at Date | The column's last updated date. |
value JSON | Always return null. Use linked_items and linked_item_ids instead. |
Filter
You can filter items by dependency values using the items_page object. The dependency column supports the following operators:
| Operators | Compare Values |
|---|---|
any_of | Item IDs the item depends on |
not_any_of | Item IDs to exclude |
is_empty | [] |
is_not_empty | [] |
Example
The following example returns all items that depend on item 9876543210.
query {
boards(ids: 1234567890) {
items_page(
query_params: {
rules: [
{
column_id: "dependent_on"
compare_value: [9876543210]
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: 1234567890,
columnId: "dependency_mksvv00d",
compareValue: [9876543210],
operator: "any_of",
};
const response = await mondayApiClient.request(query, variables);Mutations
Update
You can update a dependency column using the change_multiple_column_values mutation by passing an array of dependent item IDs.
To add dependencies, send an array of item IDs:
mutation {
change_multiple_column_values(
item_id: 9876543210
board_id: 1234567890
column_values: "{\"dependency\": {\"item_ids\": [\"11223344\", \"44332211\"]}}"
) {
id
}
}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({
dependency_mksvv00d: {
item_ids: ["9572374902"] // dependency_mksvv00d is the column ID
}
}),
};
const response = await mondayApiClient.request(query, variables);Clear
You can clear a dependency column by passing null or an empty object in column_values.
mutation {
change_multiple_column_values(
item_id: 9876543210
board_id: 1234567890
column_values: "{\"dependency\": 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({
dependency_mksvv00d: null // dependency_mksvv00d is the column ID
}),
};
const response = await mondayApiClient.request(query, variables);