Skip to content
← Back to activity

Solution skill

How do I create a new board item in Monday.com w/ column values? Code is not working

Version 2Sign in to save

Complete solution

How do I create a new board item in Monday.com w/ column values? Code is not working. Here was the solution: ``` const variables = ({ boardId : 00000000, groupId: "new_group", itemName : "New Item", columnValues: JSON.stringify({ people78: { personsAndTeams: [ { id: 00000000, kind: "person" } ] }, text0: "Yosemite Sam", dropdown: { labels: [ "TAM" ] }, }) }); const query = `mutation create_item ($boardId: Int!, $groupId: String!, $itemName: String!, $columnValues: JSON!) { create_item ( board_id

TL;DR

Here was the solution: `` const variables = ({ boardId : 00000000, groupId: "new_group", itemName : "New Item", columnValues: JSON.stringify({ people78: { personsAndTeams: [ { id: 00000000, kind: "person" } ] }, text0: "Yosemite Sam", dropdown: { labels: [ "TAM" ] }, }) }); const query = mutation createitem ($boardId: Int!, $groupId: String!, $itemName: String!, $columnValues: JSON!) { createitem ( boardid: $boardId, groupid: $groupId, itemname: $itemName, columnvalues: $columnValues ) { id } }; monday.api(query, {variables}).then((res) => { console.log('new item info: ', res); });

Fix

  1. Here was the solution: `` const variables = ({ boardId : 00000000, groupId: "new_group", itemName : "New Item", columnValues: JSON.stringify({ people78: { personsAndTeams: [ { id: 00000000, kind: "person" } ] }, text0: "Yosemite Sam", dropdown: { labels: [ "TAM" ] }, }) }); const query = mutation createitem ($boardId: Int!, $groupId: String!, $itemName: String!, $columnValues: JSON!) { createitem ( boardid: $boardId, groupid: $groupId, itemname: $itemName, columnvalues: $columnValues ) { id } }; monday.api(query, {variables}).then((res) => { console.log('new item info: ', res); }); `` Expected: You get the expected result; the problem is gone.

When to use

  • You are dealing with this situation.
  • The symptom matches: How do I create a new board item in Monday.com w/ column values? Code is not working.

When NOT to use

  • Unrelated issues with a different cause.
  • You need general documentation for the tool; check the official docs instead.

Compatibility

Reported per the linked source.

Variant phrasings

How do I create a new board item in Monday.com w/ column values? Code is not working

Why it happens

Stack Overflow question (score 3, has accepted answer): I'm using the Monday.com API in a React bootstrapped app. I can create a new board item successfully with an item name... `` monday.api( mutation { createitem ( boardid: ${myBoardId}, groupid: "newgroup", itemname: "new item creation", ) { id } } ) ...but when I try to add additional column values I get a POST 500 error. monday.api( mutation { createitem ( boardid: ${myBoardId}, groupid: "newgroup", itemname: "new item creation", column_values: { person: 00000000, } ) { id } } ) I've tried passing a string in for the column values... `` let columnValues =

Edge cases

  • If your error message differs even slightly, this is probably a different issue; search the exact text.
  • If the fix does not help, capture the full error output and check the source link for updates.

Evidence

Stack Overflow question (score 3, has accepted answer): I'm using the Monday.com API in a React bootstrapped app. I can create a new board item successfully with an item name... `` monday.api( mutation { createitem ( boardid: ${myBoardId}, groupid: "newgroup", itemname: "new item creation", ) { id } } ) ...but when I try to add additional column values I get a POST 500 error. monday.api( mutation { createitem ( boardid: ${myBoardId}, groupid: "newgroup", itemname: "new item creation", columnvalues: { person: 00000000, } ) { id } } ) I've tried passing a string in for the column values... let columnValues = Resolved: Here was the solution: `` const variables = ({ boardId : 00000000, groupId: "newgroup", itemName : "New Item", columnValues: JSON.stringify({ people78: { personsAndTeams: [ { id: 00000000, kind: "person" } ] }, text0: "Yosemite Sam", dropdown: { labels: [ "TAM" ] }, }) }); const query = mutation create_item ($boardId: Int!, $groupId: String!, $itemName: String!, $columnValues: JSON!) { create_item ( board_id: $boardId, group_id: $groupId, item_name: $itemName, column_values: $columnValues ) { id } }; monday.api(query, {variables}).then((res) => { console.log('new item info: ', res); }); ``` Source: https://stackoverflow.com/questions/67439159/how-do-i-create-a-new-board-item-in-monday-com-w-column-values-code-is-not-wor

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_BunQUCM6TFUOBoxwaJSQ3A" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">How do I create a new board item in Monday.com w/ column values? Code is not working <span>— Vectle</span></a>