for(var i=0; i<sheet.getMaxColumns(); i++){
var params[i] = e.values[i];
}
console.log(params);
for(var z=0; z<paramsInfo.length; z++){
var paramsInfoCheck = paramsInfo[z];
var template = HtmlService.createTemplateFromFile(paramsInfoCheck.name);
template[paramsInfoCheck.name] = params[paramsInfoCheck.number];
template.recorded = params[51];
template.remarks = params[52];
if((params[paramsInfoCheck.number] < paramsInfoCheck.min) || (params[paramsInfoCheck.number] > paramsInfoCheck.max)){
MailApp.sendEmail(recipients,
"Parameter Out of Range Notification",
"",{htmlBody: template.evaluate().getContent() + spreadsheetlink});
}
}
As you can see on the picture, it ran 2 console.log when I only have 1 console.log, the first log captures those values while the second one doesn't.
- IGNORE THE NULL AFTER 'Test' - As those values are not meant to be captured, hence its null since there are nothing on the form.
Currently I have a form that I use to collect some data. It has over 50+ columns.
I have another for loop
and an if loop
that I use to send an email if some of the values that are keyed in is not within a range. I have using a onFormSubmit
event trigger.
When I console.log
my array of values. Some values are null
however in the spreadsheet there are values at the specific column number.
I'm assuming due to the large data, the program does not have enough time to process it to put in the array and run the MailApp
function. Have this ever happen to anyone?
My execution logs shows completed without errors but some values are missing or rather null