Skip to main content

Create a new item with some columns values

  • November 3, 2021
  • 3 replies
  • 1774 views

  • Participating Frequently

Hello,

I’m trying to use the API to create new item to an existing board.
I used the create_item function found in the documentation, but unfortunately, my item was created but without the columns I provided.

Here’s my query

   mutation ($board: Int!, $col:JSON, $group: String) {
   create_item (board_id: $board, group_id: $group, item_name: "incieeedent test", column_values: $col) {
         id
     }
 }

And here how I passed my columns:

{
  ...
  "col": "{\\"Action\\": \\"foo\\"}",
  ...
}

If I try to remove the " then I have a 500 error status.

Any tips on how to send columns values?

Thanks!

This topic has been closed for replies.

3 replies

  • Author
  • Participating Frequently
  • November 3, 2021

My bad, I did not understand well enough the documentation: I thought I need to pass the column title, but you need to pass the column ID, which is obviously not the same.


AlexSavchuk
Forum|alt.badge.img
  • monday.com Team Member
  • November 3, 2021

@beben

Thanks so much for letting us know you’ve tackled this one already! Great catch and I do agree that could be the root cause here 🙂

Thank you for pointing out the solution here. Just let us know if you need anything else.

-Alex


  • November 10, 2021

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.