I made a Google form and a script that sends a mail with the content of the form.
There are 3 fields: A, B, C that are not mandatory. Example: If we enter 1, 5, and 8 then the script is writing:
A=1, B=5, C=8
The problem is that if B is not given a value (1 for A and 3 for C), then I get the output:
A=1, B=3, C=
There is a shift of the values! What can I do ?
function sendResponses() {
var form = FormApp.getActiveForm();
var responses = form.getResponses();
var lastrow = responses.length - 1;
var itemResponses = responses[lastrow].getItemResponses();
var Total = "A=" + itemResponses[0].getResponse() + ", B=" + itemResponses[1].getResponse() + ", C=" + itemResponses[2].getResponse(),
}
Thank you, Frédéric