I am currently scripting to analyze results for a google form with this kind of function :
function sendResponses(e) {
var thisResponse = e.response;
var itemResponses = thisResponse.getItemResponses();
};
I want to get the results from this form to fill a sheet but my form has some not requiered chekboxes. Therefore, depending on the unchecked boxes, the size of itemResponses is not the same.
For example, if the 5th question (over 10) is a checkbox, when the checkbox 5 is not checked, itemResponses[5] would be the answer of the 6th questions. It is massing up the recording of the answer in the sheet which is done as follow
var nameDemandeur = itemResponses[5].getResponse();
var cell = sheetElect.getRange(long, 4) //(row, column) in the sheetElect
cell.setValue(nameDemandeur);
Does someone know how to avoid this problem and to take into account unchecked boxes ?
Aucun commentaire:
Enregistrer un commentaire