I have a Google Form with two numbers field, so in the Answer destination spreadsheets I have three columns: SUBMIT-DATE, NUM1, NUM2
I add a fourth column TOT, not field in the form, with this formula:
ARRAYFORMULA(B2:B+C2:C)
So in the fourth column i have a SUM for every row
I bound this script to spreadsheet:
function onFormSubmit(e){
var subject = "TRY GAS";
var body = e.namedValues['NUM1']+ "+" +e.namedValues['NUM2']+ "=" +e.namedValues[TOT];
MailApp.sendEmail("[email protected]", subject, body);
}
And I set trigger for onFormSubmit
But the email i received is:
34+43=
While in the spreadsheet under column TOTAL, 77 is displayed.
I think the problem is var e.namedValues that doesn't contain TOT because it isn't a form field
How can I pass this value on form submit??