API: Can I have strings with new line/line break in column_values?

I’ve tried something like this:

mutation {
        create_item (board_id: 123, 
            group_id: "my_group", 
            item_name: "Test Item",
            column_values: "{
                \"text_4\" : \"Line 1
Line 2\"
            }"            
        ) {
            id
        }
    }

Or:

mutation {
        create_item (board_id: 530995076, 
            group_id: "new_group11081", 
            item_name: "Melanie",
            column_values: "{
                \"text_4\" : \"Line 1\nLine 2\"
            }"            
        ) {
            id
        }
    }

Both of these result in HTTP 500 error in my program, on the “try it yourself” site, it results in “TypeError: NetworkError when attempting to fetch resource.”.

Am I not allowed to insert line breaks into text column values?

Howdy @royt :wave:

You cannot utilize any line breaks within the Text Column at this time. Whether through the API or manually inputting text into the monday.com UI, the Text Column does not support line breaks.

With that said, you can utilize a line break within an update using <br>.

For example, the this API call:

mutation {
  create_update (item_id: 620638196, body: "I like turtles <br> and I like ice cream") {
    id
  }
}

Generates the below update:

image

Might something like that work for your use case?

-Scott

1 Like