I want to create a function on Google Apps Script that takes a different value as an argument for each execution on the triggers that I'm going to set. For example :
customfunction (formid)
{
var form = FormApp.openById(formid);
//rest of the function
}
then I want to call this function on a specific trigger and pass the formid argument. Is there any way to do that ? I'm still new to Google Apps Script so I might be missing something
I suggest you take a look at a javascript course. But you mean something like this..
function logFormTitle(){
const idArray = ['xx', 'yy', 'zz']
idArray.forEach(id => {
const title = getFormTitle(id)
console.log(title)
})
}
function getFormTitle(id){
const form = FormApp.openById(id)
return form.getTitle()
}