Google电子表格从其自己的网址读取参数 [英] Google spreadsheet reading parameters from its own URL

查看:83
本文介绍了Google电子表格从其自己的网址读取参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我可以在URL中添加这些参数来打开电子表格,然后在电子表格中添加这些参数加载这些到一些单元格?



所讨论的电子表格是私人共享的,并且使用URL的用户被授予编辑权限。

解决方案

以下是可供不同Google产品使用的触发器表格: 触发器的可用类型



在独立应用程序中,您可以运行 doGet()函数。 doGet()函数自动运行。有一个 e.parameter 选项可用于 doGet(e),它将解析URL搜索字符串设置。但是不能将 doGet()函数添加到工作表。



可用的URL参数是在本文档中列出:



URL参数



但是,这些网址参数适用于Web Apps和Google协作平台小工具,而不适用于Google表格。



您可以使用中间的Google Apps脚本来发送网址请求,然后应用脚本处理网址搜索字符串参数,然后打开电子表格。



因此,您不是使用Google工作表网址打开电子表格,而是使用部署的网络应用的网址。然后,用户需要点击链接打开电子表格。



一旦Web应用程序解析了URL搜索字符串值,您需要编写某种脚本做了类似于使用电子表格服务将这些值写入电子表格的功能


I would like to open a Google Spreadsheet with a few parameters.

Can I add these few parameters in the URL to open the spreadsheet, and then in the spreadsheet load these into some cells?

The spreadsheets in question are privately shared, and the users using the URLs is granted permission to edit.

解决方案

Here is a table of triggers that are available to the different Google Products:

Available Types of Triggers

In a Stand Alone app, you can run a doGet() function. The doGet() function runs automatically. There is an e.parameter option available to doGet(e) that will parse URL search string settings. But a doGet() function can't be added to a Sheet.

The URL parameters that are available are listed in this documentation:

URL Parameters

But, those URL Parameters are for Web Apps and Google Sites Gadgets, not for a Google Sheet.

You could have an intermediary Google Apps Script that you send the URL Request to, and then the Apps Script processes the URL Search String parameters, and then opens up the spreadsheet.

So, instead of using the Google Sheet URL to open the spreadsheet, you'd be using a URL of the deployed web app. Then the user would need to click a link to open the spreadsheet.

Once the web app parsed the URL Search string values, you would need to write some kind of script that did something like write those values into your spreadsheet using the Spreadsheet Service

这篇关于Google电子表格从其自己的网址读取参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆