Hi,
I am trying to use the API to create a new item on an existing board, populated with column values. I can successfully create the item without column values, but as soon as I try to add them I get errors.
let query ='mutation { create_item (board_id: [boardid], group_id: [groupid], item_name: "Just put those column values in please", column_values: \"{ \"long_text\": {\"text\":\"Testing testing\" }}\") { id }}'
const response = await fetch('https://api.monday.com/v2/', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': process.env.GATSBY_MONDAY_TOKEN,
},
body: JSON.stringify({
query: query
})
})
current error is: “Parse error on ": " (STRING) at [1, 153]”, but I have played around with so many different variations of escaping quotes, different fields, etc. that I have gotten different variations on that error. I can successfully pass column values using graphQL from Postman, just not from my JS code (in React/Gatsby). I also tried passing query variables following the responses to several other users’ issues, but in that case I always get “variable is referenced but not defined” errors.
Thanks for any help on this - I have been pulling my hair out for hours on this now!