Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 电子表格自定义函数在脚本编辑器中未运行时返回错误_Google Apps Script_Google Sheets_Google Fusion Tables - Fatal编程技术网

Google apps script 电子表格自定义函数在脚本编辑器中未运行时返回错误

Google apps script 电子表格自定义函数在脚本编辑器中未运行时返回错误,google-apps-script,google-sheets,google-fusion-tables,Google Apps Script,Google Sheets,Google Fusion Tables,我在电子表格中创建了自定义函数,它从融合表中获取数据 function getData(){ var tableId = "********"; var sql = 'SELECT * FROM ' + tableId + ' LIMIT 100'; var response = FusionTables.Query.sql(sql); Logger.log(response); return response; } 当我在脚本编辑器中运行函数时,它工作,但当我在电子表格的

我在电子表格中创建了自定义函数,它从融合表中获取数据

function getData(){
  var tableId = "********";
  var sql = 'SELECT * FROM ' + tableId + ' LIMIT 100';
  var response = FusionTables.Query.sql(sql);
  Logger.log(response);
  return response;
}
当我在脚本编辑器中运行函数时,它工作,但当我在电子表格的单元格中调用函数时,它返回:
超出未经验证使用的每日限制。继续使用需要注册。

对电子表格和脚本编辑器中的数据有不同的处理方法吗?还是我做错了什么


谢谢你的任何想法

自定义函数无法访问可以访问用户数据的用户服务。文档中列出了可在自定义功能中使用的服务

使用执行API可以解决这个问题。基本思想是将脚本发布为执行api,并从自定义函数中调用它。查看我在以下网站上制作的演示:


这里有什么帮助吗?很遗憾,没有,我的Fusion Tables API已启用。此外,那个家伙在访问自己的网站时遇到问题,我正在尝试直接连接高级Google服务-Fusion Tables v2。谢谢,这回答了我的问题,我做错了什么。不幸的是,你的脚本看起来有点过时了——谷歌几乎不推荐使用这个脚本。然而,我有了新的思考方式。什么是折旧?我在生产现场使用此方法。我发现了此方法-ScriptApp.getProjectKey(),新替换为ScriptApp.getScriptId()