Hi, I’m building a way to automate the duplicate and creation of group items in my monday board through Google Sheet and Appsscript. However, I’m facing a problem with Parse error on “-”, and I can’t seem to get rid of it even after trying to escape it from my variable. Some help here will be good. I’ve copied the code below with an example of the escapedFullProjectName variable
function overviewGroupCreate(escapedFullProjectName){
//Create Monday board and tasks lists of it
var escapedFullProjectName = xxx-1234
var mutation = ‘mutation{ create_group (board_id:’+overviewId+‘, group_name:’+escapedFullProjectName+‘) {id} }’;
var response = UrlFetchApp.fetch(“https://api.monday.com/v2”, {
method: ‘post’,
headers: {
‘Content-Type’: ‘application/json’,
‘Authorization’: apiKey
},
payload: JSON.stringify({
‘query’: mutation
})
})
var json = response.getContentText()
var data = JSON.parse(json)
//cache the createdOverviewId
cache.put(‘createdOverviewId’,data[‘data’][‘create_group’][‘id’],600)
Logger.log(‘Overview Group Created’)
}
