Hello,
Having major issues updating the tag on an item column. I’ve tried various things but no luck. It appears that some value is being populated in the tag field, but not the actual tag. In monday, the field gains the little “+” symbol when this code runs, but nothing is visible. When I right click, I can “clear values” and the “+” disappears.
Updating other columns using this function works fine. Just the tags is an issue. I don’t get any errors. I’ve tried various things some below:
"tags__1": { tag_ids: [929292] },
[tags__1]: { tag_ids: [929292] },
"tags__1": { tag_ids: ["929292"] },
Here’s my code. Please help!
async function updateItem() {
try {
const response = await fetch(“https://api.monday.com/v2”, {
method: “post”,
headers: {
“Content-Type”: “application/json”,
Authorization: mondayAPI,
},
body: JSON.stringify({
query: mutation ($myBoardId: ID!, $myItemId: ID!, $myColumnValues: JSON!) { change_multiple_column_values(item_id: $myItemId, board_id: $myBoardId, column_values: $myColumnValues) { id } }
,
variables: {
myBoardId: “6775681461”,
myItemId: “6791619434”, // Replace with your actual item ID
myColumnValues: JSON.stringify({
“tags__1”: { tag_ids: [929292] },
// [“numbers”]: “123”,
}),
},
}),
});
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
return data;
} catch (error) {
console.error(“Error updating item:”, error);
return error;
}
}
const updatedItem = await updateItem();