谷歌电子表格的“查询"功能可以在谷歌应用程序脚本中使用吗? [英] Can the google spreadsheet 'query' function be used in google apps script?

查看:24
本文介绍了谷歌电子表格的“查询"功能可以在谷歌应用程序脚本中使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种以编程方式填充电子表格的方法,该电子表格可根据登录用户过滤来自另一个电子表格的数据.

I'm looking for a way to programmatically populate a spreadsheet that filters data from another spreadsheet based on the logged in user.

我可以使用电子表格中的查询功能来做到这一点.但是,无法找到从应用程序脚本调用查询函数的方法?

I am able to do this using the query function inside a spreadsheet. BUT, unable to figure out a way to call the query function from apps script?

这能做到吗?将不胜感激示例代码.谢谢.

Can this be done? Would appreciate sample code. Thanks.

推荐答案

不,Query 函数没有 API 允许从 Google Apps 脚本调用它.(事实上​​,没有办法以这种方式调用任何电子表格函数.)

No, there is no API for the Query function that allows it to be called from Google Apps Script. (There is no way to call ANY spreadsheet function in this way, in fact.)

不过,您无需自己编写即可获得一些类似的功能.二维数组库 包括各种过滤器"可让您检索匹配行的函数.

You can get some similar functionality without writing it all yourself, though. The 2D Arrays Library includes a variety of "filter" functions that let you retrieve matching rows.

这篇关于谷歌电子表格的“查询"功能可以在谷歌应用程序脚本中使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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