I’m working on a bash script to perform multiple automations in monday. The script is already able to create boards, create groups, create items in the correct group… the only thing missing now for me is to enter a value into a specific column for a new created item. Can someone maybe help with this? I’m new to the monday API or GraphQL API in general.
This line of code works to create an item and I know the ID of the column I want to add a value in is “numbers”. What would I have to add to this line to do this?
The easiest thing to do is play around with the API Playground (avatar > developer > API playground). Your mutation is escaping the item name (which is a normal string and doesn’t need escaping) and is missing the column_values. That one needs escaping as the API expects a stringified JSON of {columnid: value} pairs. Each column type require a different format for the value. Here is one for setting a date column (which requires a JSON format for the value) based on your input (assuming the boardId and groupId are both correct, and the columnId for the date column is “date”. Take care, you need the groupId, not the goupName.
Background is: I want to create items on a board which get a specific number as “planned time in hours” added. The board is created based on a template that already has a lot of formular_columns to then work with this value. When I tried to get the ID of this column, this was the output I received:
The line without the “column_values” part works without any issues. So creating the board and creating an item with just a title in the correct group… works like expected.
You really need to understand that each column type requires a different format. Where a date column from my example needs {date: "2022-10-12} a number column just need a number (not a JSON). See also: Numbers