Learn how to read, update, and clear the monday doc column on boards using the platform API
Workdocs are essentially virtual whiteboards that enable teams and organizations to collaborate and communicate. The monday doc column stores these documents in one location and allows you to update and create new ones in the column itself. The API allows you to read, update, and clear the monday doc column.
Read a monday doc column
You can query the monday doc column using the column_values object that enables you to return column-specific subfields by sending a fragment in your query. Values for the monday doc column are of the DocValue type.
query {
items (ids:[1234567890, 9876543210]) {
column_values {
... on DocValue {
file
}
}
}
}Fields
| Field | Description |
|---|---|
column Column! | The column the value belongs to. |
file FileDocValue | The column's attached document. |
id ID! | The column's unique identifier. |
text String | The column's value as text. This field will always return "". |
type ColumnType! | The column's type. |
value JSON | The column's JSON-formatted raw value. |
value JSON | The column's JSON-formatted raw value. |
Create a doc column
You can use the create_column mutation to create a new doc column.
mutation {
create_column(
board_id: 1234567890
column_type: doc
title: "Task info"
) {
id
}
}Create a doc in a doc column
You can create a doc in the monday doc column using the create_doc mutation. Please note that this requires the docs:write scope.
mutation {
create_doc(
location: {
board: {
item_id: 1234567890
column_id: "monday_doc"
}
}
) {
id
}
}Clear a monday doc column
You can clear a monday doc column using the change_column_value mutation and passing "{\"clear_all\": true}" in the value argument.
mutation {
change_column_value(
board_id: 1234567890
item_id: 9876543210
column_id: "monday_doc"
value: "{\"clear_all\": true}"
) {
id
}
}