There are two patterns for retrieving the presented values. For both templates, the function for extracting values ββfrom the form view must be set as a trigger. Details on Installable Triggers https://developers.google.com/apps-script/guides/triggers/installable .
1. Script opens in a spreadsheet.
In this case, by setting the trigger, you can get the passed values ββusing the script. Detailed information on event objects https://developers.google.com/apps-script/guides/triggers/events#form-submit .
Script:
function onSubmit(e){ Logger.log("%s", JSON.stringify(e)); }
Result:
{ "values": [ "date and time", "test" ], "namedValues": { "fromtestform": [ "test" ], "timeStamp": [ "date and time" ] }, "range": { "columnStart": 1, "rowStart": 2, "rowEnd": 2, "columnEnd": 2 }, "source": {}, "authMode": {}, "triggerUid": ##### }
2. Script opens in form.
In this case, the presented values ββcan be obtained by following the script. Detailed information https://developers.google.com/apps-script/reference/forms/form-response .
Script:
function onSubmit(e){ Logger.log("authMode=%s, source.getId()=%s", e.authMode, e.source.getId()); var items = e.response.getItemResponses(); for (i in items){ Logger.log("getItem().getTitle()=%s, getResponse()=%s", items[i].getItem().getTitle(), items[i].getResponse()); } }
Result:
authMode=FULL, source.getId()=
If I misunderstand your question, sorry.