如何在Google Apps脚本中捕获具有相同标识符的多个GET参数 [英] How to capture multiple GET parameters with the same identifier in Google Apps Script
问题描述
我有一个通过Google Apps脚本部署为Web应用程序的表单,并且有几个字段允许您选择多个值(例如,类似于多选下拉列表).如果我在GET请求中有多个具有相同标识符的值,那么我只会在应用程序脚本中将第一个作为参数.
I have a form deployed as a Web App through Google Apps Script and a couple fields allow you to select multiple values (ie. Like a multi-select dropdown). If I have multiple values with the same identifier in the GET request I only get the first one as a parameter in apps script.
如何使用应用脚本捕获具有相同标识符的多个GET参数?
How can I use apps script to capture multiple GET parameters with the same identifier?
推荐答案
解决了这个问题.
在doGet
或doPost
函数中,无需调用e.parameter
,而是需要调用e.parameters
来获取与数组同名的多个参数.
In your doGet
or doPost
function, instead of calling e.parameter
you need to call e.parameters
to get multiple parameters with the same name as arrays.
文档: https://developers.google.com/apps-script/guides /web?hl = zh-CN#url_parameters
这篇关于如何在Google Apps脚本中捕获具有相同标识符的多个GET参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!