Hey Scott, welcome 👋
Good question! You’re right, you’ll need to use the column ID to assign “hello world” to the description column. Other than that, your syntax looks great so far.
We’re working on a way to make getting the column IDs easier, but for now I’d suggest using this query to get the title and ID of each column on a given board:
query {
boards(ids:xxxxx) {
columns {
id
title
}
}
}
Let me know if that helps!
Thanks for the help. I issued the query with the following results:
{
“data”: {
“boards”: r
{
“columns”: c
{
“id”: “name”,
“title”: “Name”
},
{
“id”: “person”,
“title”: “Owner”
},
{
“id”: “long_text”,
“title”: “Description”
},
{
“id”: “email”,
“title”: “Email”
},
{
“id”: “status”,
“title”: “Status”
},
{
“id”: “date”,
“title”: “Due”
},
{
“id”: “check”,
“title”: “Emergency”
}
]
}
]
},
“account_id”:
}
From this, I changed my call to (this is not exact because your editor is removing slashes and making formatting changes):
mutation {
create_item (
board_id: ,
group_id: “Incoming”,
item_name: “Test item:created via API”,
column_values:
“{
"long_text":"Hello world",
"email" :{"email":"test@test.com","text":"test@test.com"}
}”
) {
id
}
}
But it returned an error:
{
“error_code”: “ColumnValueException”,
“status_code”: 400,
“error_message”: “change_column_value invalid value”,
“error_data”: {
“column_value”: “Hello world”,
“column_type”: “LongTextColumn”
}
}
I checked the syntax for long text columns (https://monday.com/developers/v2#column-values-section-longtext), and mine seems to be correct. We’re closer, but not quite there yet. Can you offer any more guidance?
Thanks,
Hey Scott!
Almost there – the text column and long text column have slightly different data structures.
If you were updating a text column, you’d send something like this (myColumn is the column ID of my imaginary column):
column_values: {
"myColumn" : "\\"Hello world\\""
}
However, for the long text column, you need to send a JSON object with “text” as the key. Something like this:
column_values: {
"myColumn" : "{\\"text\\" : \\"Hello world\\"}"
}
Let me know if that does the trick.
We’re close. I have working code, but I have a question about it:
mutation {
create_item (
board_id: 262175425,
group_id: "Incoming",
item_name: "Test item:created via API",
column_values:
"{
“long_text” :{“text” :“This is where the message body was in the email. What happens to paragraphs?”},
“email” :{“email”:“What is this part?”,“text”:"sender@invitae.com"}
}"
) {
id
}
}