Text
The text column contains any text you want to store in a column on your board(s). Our API fully supports the text column, so you can filter, read, update, and clear it via the API.
Filtering the text 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 text column's supported operators and compare values.
Operators | Compare values |
---|---|
any_of | "" (blank values) |
not_any_of | "" (blank values) |
is_empty | null |
is_not_empty | null |
contains_text | The partial or whole text value to filter by |
not_contains_text | The partial or whole text value to filter by |
Pro tip
items_page
is only available in API version2023-10
for now.
The following example returns all items on the specified board without an empty text column.
query {
boards (ids: 1234567890) {
items_page (query_params: {rules: [{column_id: "text", compare_value: [""], operator:not_any_of}]}) {
items {
id
name
}
}
}
}
Reading the text column
You can query the text 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 text column are of the TextValue
type.
Pro tip
column_values
v2 fields are only available in API version2023-10
.
query {
items (ids:[1234567890, 9876543210]) {
column_values {
... on TextValue {
text
value
}
}
}
}
Fields
Field | Description |
---|---|
column Column! | The column the value belongs to. |
id ID! | The column's unique identifier. |
text String | The column's textual value. |
type ColumnType! | The column's type. |
value JSON | The column's JSON-formatted raw value. |
Column values v1
You can return the data in a text column in two different formats when you query by column values. The text
field will return the text as a simple string. The value
field will return the text as a JSON string.
Removing column values v1 support
column_values
v1 fields will no longer be supported in API versions2023-10
and later.
{
"text": "Insert text here.",
"value": "\"Insert text here.\""
}
Updating the text column
You can update a text column using the change_simple_column_value
mutation and sending a simple string in the value
argument. You can also use the change_multiple_column_values
mutation and pass a JSON string in the column_values
argument.
Simple strings
To update the text column, send a simple String
value.
mutation {
change_simple_column_value (item_id:9876543210, board_id:1234567890, column_id:"text", value: "Sample text") {
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!, $myColumnValue: String!, $columnId: String!) { change_simple_column_value (item_id:$myItemId, board_id:$myBoardId, column_id: $columnId, value: $myColumnValue) { id } }",
variables : JSON.stringify({
myBoardId: 1234567890,
myItemId: 9876543210,
columnId: "text",
myColumnValue: "Sample text"
})
})
})
JSON
To update the text column using JSON, send the value as a string. 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: "{\"text\" : \"Sample text\"}") {
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: "{\"text\" : \"Sample text\"}"
})
})
})
Clearing the text column
You have two options to clear a text column. First, you can use the change_multiple_column_values
mutation and pass null
or an empty string 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: "{\"text\" : 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: "{\"text\" : null}"
})
})
})
You can also use the change_simple_column_value
mutation and pass an empty string in the value
argument.
mutation {
change_simple_column_value(item_id:9876543210, board_id:1234567890, column_id: "text", value: "") {
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!, $myColumnValue: String!, $columnId: String!) { change_simple_column_value (item_id:$myItemId, board_id:$myBoardId, column_id: $columnId, value: $myColumnValue) { id } }",
variables : JSON.stringify({
myBoardId: 1234567890,
myItemId: 9876543210,
columnId: "text",
myColumnValue: ""
})
})
})
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! 😎
Updated 3 months ago