I would like to add data to my EmailTemplate in the for loop. Unfortunately this does not work as expected. I get the error code "Invalid assignment left-hand side." every time. I want the counter to go up after each run and adapt to the temp file.
Here is the "problem Code". Without it the Script runs perfectly.
var emailTemp = HtmlService.createTemplateFromFile("template"); // Access to the HTML document
var z = 1;
var softindexlen = softwareindex.length;
for(var b = 0; b<softindexlen; b++){
if (b<6){
emailTemp.PCCI+z = computerarray[softwareindex[b][0]];
emailTemp.PCEquip+z = computerarray[softwareindex[b][7]];
emailTemp.PCassetname+z = computerarray[softwareindex[b][1]];
emailTemp.PCassettag+z = computerarray[softwareindex[b][4]];
emailTemp.PCserial+z = computerarray[softwareindex[b][9]];
emailTemp.PCmanufac+z = computerarray[softwareindex[b][5]];
emailTemp.PCmodel+z = computerarray[softwareindex[b][6]];
z++;
}else{
emailTemp.pcnotification = pcnotification;
break;
}
}
Hopefully someone of you can help me ! (And sorry if the header isn't the best )
Many thanks in advance!