gpt4 book ai didi

javascript - 无论如何,我可以在使用应用程序脚本提交时获取谷歌表单的网址吗

转载 作者:行者123 更新时间:2023-12-03 04:36:11 33 4
gpt4 key购买 nike

我正在尝试在 Google 表单的网址中传递查询参数,并将该表单提交给其他人来填写,因此我希望 onSubmit 事件检查该查询参数并获取它。

我的 onSubmit 事件有以下代码:

function onFormSubmit(e){
var formResponses = FormApp.getActiveForm().getResponses();
var formResponse = formResponses[formResponses.length-1];
var itemResponses = formResponse.getItemResponses();

for (var j = 0; j < itemResponses.length; j++) {
var itemResponse = itemResponses[j];
Logger.log('Last response to the question "%s" was "%s"',
itemResponse.getItem().getTitle(),
itemResponse.getResponse());
}

var me = Session.getActiveUser().getEmail();
GmailApp.sendEmail(me, 'Google Form Notification Submission', 'Test');

}

当用户填写表单时,我发送的网址为 "https://docs.google.com/forms/d/e/xyxyxyxyxyxyyx/viewform?usp=sf_link?patient_id=33333 " ,如何在 formSubmit 上获取 Patient_id?

最佳答案

Google 表单仅处理用于预填写表单的参数。要了解如何预填写 Google 表单,请参阅发送包含预填答案的表单 Send your form to peopleIs it possible to 'prefill' a google form using data from a google spreadsheet? .

在评论中, jack ·布朗 shared链接到Get URL Link to a "SECTION" only其中有 answer由他编写,其中包含提供 HTML/JavaScript/CSS 表单的 Web 应用程序代码。上comment Sandy Good 在回答另一位OP的问题时,她还评论说,Google Forms 中不包含预期的 Google Form 行为/Google Form 功能,您可以使用 Google Apps Script Web 应用程序作为替代方案。

关于javascript - 无论如何,我可以在使用应用程序脚本提交时获取谷歌表单的网址吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43292519/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com