Dependency

The dependency column allows you to set up connections between items in the same board. They can then be visually represented in the Gantt View or Widget, or combined with automations. Our API fully supports the dependency column, so you can filter, read, update, and clear it via the API.

Filtering the dependency 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 dependency column's supported operators and compare values.

OperatorsCompare values
any_ofThe item IDs to filter by
not_any_ofThe item IDs to filter by
is_emptynull
is_not_emptynull

👍

Pro tip

items_page is only available in API version 2023-10 for now.

The following example returns all items on the specified board that are dependent 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
      }
    }
  }
}

Reading the dependency column

You can query the dependency column using the column_values object. The object has different fields based on which API version you are using. Column values v2 fields will be available in API versions 2023-10 and later, while column values v1 fields are only supported in versions 2023-07 and 2023-04.

Column values v2

The column_values object enables you to return column-specific subfields by sending a fragment in your query. Values for the dependency column are of the DependencyValue type.

👍

Pro tip

column_values v2 fields are only available in API version 2023-10.

query {
  items (ids:[1234567890, 9876543210]) {
    column_values {
      ... on DependencyValue {
        linked_item_ids
        updated_at
      }
    }
  }
}

Fields

FieldDescription
column Column!The column the value belongs to.
display_value String!The names of the dependent items, separated by commas.
id ID!The column's unique identifier.
linked_item_ids ID!The unique identifiers of the linked items.
linked_items [Item!]!The linked items.
text StringThe column's value as text. Please note: this field will return no data in API version 2023-10. Use display_value instead.
type ColumnType!The column's type.
updated_at DateThe column's last updated date.
value JSONThe column's JSON-formatted raw value.

Column values v1

You can only return the data in a dependency column in one format when you query by column values. The text field will return an empty result. The value field will return metadata about the dependent-on items as a JSON string.

🚧

Removing column values v1 support

column_values v1 fields will no longer be supported in API versions 2023-10 and later.

{
  "text": "",
  "value": "{\"linkedPulseIds\":[{\"linkedPulseId\":2973227079}]}"
}

Updating the dependency column

You can update a dependency 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 add a dependent-on item to the dependency column, send the item IDs as an array. You will get an error if the items do not belong to the connected board.

mutation {
  change_multiple_column_values (item_id:9876543210, board_id:1234567890, column_values: "{\"dependent_on\" : {\"item_ids\" : [0987654321]}}") {
    id
  }
}
fetch ("https://api.monday.com/v2", {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
    'Authorization' : 'YOUR_API_KEY_HERE'
  },
  body: JSON.stringify({
    'query' : "mutation ($myBoardId:Int!, $myItemId:Int!, $myColumnValues:JSON!) { change_multiple_column_values(item_id:$myItemId, board_id:$myBoardId, column_values: $myColumnValues) { id } }",
    'variables' : JSON.stringify({
      myBoardId: 1234567890,
      myItemId: 9876543210,
      myColumnValues: "{\"dependent_on\" : {\"item_ids\" : [0987654321]}}
    })
  })
})

Clearing the dependency column

You can also clear a dependency column using the change_multiple_column_values mutation and passing null or an empty object in the column_values argument. Check out this mutation in action in our Postman library or follow along with these code samples!

mutation {
 change_multiple_column_values(item_id:9876543210, board_id:1234567890, column_values: "{\"dependent_on\" : null}") { 
  id
 }
}
fetch ("https://api.monday.com/v2", {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
    'Authorization' : 'YOUR_API_KEY_HERE'
  },
  body: JSON.stringify({
    query : "mutation ($myBoardId:Int!, $myItemId:Int!, $myColumnValues:JSON!) { change_multiple_column_values(item_id:$myItemId, board_id:$myBoardId, column_values: $myColumnValues) { id } }",
    variables : JSON.stringify({
      myBoardId: 1234567890,
      myItemId: 9876543210,
      myColumnValues: "{\"dependent_on\" : null}"
    })
  })
})

📘

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! 😎