I managed to connect the Monday.com API with google sheets using Scripts and create a new item in my board, however, I can only insert the item name, how can I insert a value in my column.
Code example:
function Create_Line()
{
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheetByName("tests");
var values = sh.getDataRange().getValues();
var mondayAPIkey = "API_KEY"
for(var i=1;i<values.length;i++)
{
if(values[i][7]=="")
{
var query = "mutation($board:Int!, $name:String!,$colvals:JSON!){create_item(board_id:$board, item_name:$name, column_values:$colvals){id}}";
var variables = {
"board" : "board_id",
"name" : values[i][0], //where column A has the name I want for the item
"colvals": JSON.stringify({ "column_id": "Coluna 1", "value": "Done"}) //calling the now formatted date variable
};
var pulseID = JSON.parse(makeAPICall(mondayAPIkey, query, variables)).data.create_item.id;
sh.getRange(i+1, 8).setValue(pulseID)
}
}
}
EDIT: To explain the question in a better way, the result that I'm looking for is this:
The script runs through the entire google sheets list and creates the lines on Monday.com, the problem is that I can not fill the column value