我使用Google V4在JSON中检索数据,如下所示。这包括所有行,甚至包括由于其中一列中的筛选而当前未在电子表格UI中显示的行。
有没有一种方法可以只获取显示的行或信息,而不管行是否隐藏?
Google Apps脚本允许使用.hiddenByFilter方法(参见https://cloud.google.com/blog/products/application-development/using-google-sheets-filters-in-add-ons )进行这种数据检索。但是,无论如何我都不能在我的API查询中包含它。
$.getJSON("https://sheets.googleapis.com/v4/spreadsheets/" + SpreadsheetID + "/values/Color1!A2:Q?key=<MY_API_KEY>", function(data) {
// data.values contains the array of rows from the spreadsheet. Each row is also an array of cell values.
$(data.values).each(function() {
var location = {};
location.title = this[2];
location.latitude = parseFloat(this[10]);
location.longitude = parseFloat(this[9]);
location.institution = this[3];
//location.hidden = <?>;
locations.push(location);
});有什么变通方法吗?
发布于 2019-06-27 04:05:34
您可以使用Spreadsheets.get端点。然后使用sheets/data/rowMetadata/hiddenByUser field客户端对sheets/data/rowData/values进行过滤。
https://stackoverflow.com/questions/56777630
复制相似问题