I am using Google Sheets to run various API calls. I have done this with a variety of files and various boards in multiple Monday accounts. It seems that the items_by_column_value search is not working and I want to make sure this is a glitch on Monday’s side not in my code.
Here is the function that I use to search by item’s name:
function getPulseID(key,boardID,name){
var query = “query($board:Int!, $name:String!){items_by_column_values(board_id:$board, column_id:"name", column_value:$name){id}}”;
var variables = {
"board" : parseInt(boardID),
"name" : name
};
var data = makeAPICall(key, query, variables);
Logger.log(data);
return data;
}
Obviously when I call that function I put the proper values for the variables.
Here is the actual call to Monday (which I know works because my logic creates the item if no item is found and it is creating the item fine):
function makeAPICall(key, query, variables){
var url = “https://api.monday.com/v2”;
var options = {
"method" : "post",
"headers" : {
"Authorization" : key,
},
"payload" : JSON.stringify({
"query" : query,
"variables" : variables
}),
"contentType" : "application/json"
};
var response = UrlFetchApp.fetch(url, options);
Logger.log("API results: " + response);
return response;
}
Any suggestions or guidance would be appreciated.