I'm trying to get started with a very simple Google Form containing just a couple of questions (a multiple choice with just 2 options and a short text). After creating it, I opened the script editor and typed in
function onSubmit(e) {
Logger.log("onSubmit(%s)", JSON.stringify(e));
}
and configured onSubmit
as the handler for "form submit" trigger using the "Current project's triggers" from the "Edit" menu.
Filling in the form and submitting it now does result in the handler being called, but I only see this in the log:
[17-04-15 18:56:23:584 CEST] onSubmit({"response":{},"source":{},"authMode":{},"triggerUid":1870249629})
i.e. the response field is empty. I've also tried using FormApp.getActiveForm().getResponses()
, but it returns an array of several empty objects too (OTOH, FormApp.getActiveForm().getTitle()
does return the title I gave the form).
I suspect I need to give the script some extra permissions to access the form data, but I have no idea how to do it, nor even if this is really the problem.
Does anybody know why am I not getting the form values and what should I do to get them? Thanks in advance!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…