使用api调用获取Google工作表过滤器视图数据 [英] Get google sheet filter view data with api call
问题描述
我可以在这里显示很少的代码.我正在使用带有node.js的api调用Google表格电子表格.
在电子表格中,我创建了一堆过滤器视图
.有没有一种方法可以告诉api调用过滤后的数据,而不仅仅是获取工作表中的所有数据.
const dataFromGoogleSheets =`https://sheets.googleapis.com/v4/spreadsheets/$ {config.spreadsheetId}/values:batchGet?ranges = $ {"Sheet1"}& majorDimension = ROWS& key = $ {config.apiKey}`;
更新
sheets.spreadsheets.values.get({eBookId:"mySpreadSheetID",filterViewId:121321321,标题:过滤器"})
您无法使用有效的FilterView从Sheets API或Google Apps脚本中获取数据.
正如评论中提到的 @Tanaike 一样,您可以从FilterView中获取条件,然后在数据.
您还可以在公共问题跟踪器上对此提交功能请求..>
There's really very little code I can show here. I'm calling a google sheets spreadsheet using the api with node.js.
Within the spreadsheet, I have created a bunch of filter views
. Is there a way to tell the api to call the filtered data instead of just getting all the data in the sheet.
const dataFromGoogleSheets = `https://sheets.googleapis.com/v4/spreadsheets/${
config.spreadsheetId
}/values:batchGet?ranges=${"Sheet1"}&majorDimension=ROWS&key=${
config.apiKey
}`;
UPDATE
sheets.spreadsheets.values.get(
{
spreadsheetId: "mySpreadSheetID",
filterViewId: 121321321,
title: "Filters"
}
)
You cannot fetch data from Sheets API or Google Apps Script with an active FilterView.
As @Tanaike mentioned in the comments, you can fetch the criteria from the FilterView and reprocess it on top of the data.
You can also file a Feature Request for this on the Public Issue Tracker.
这篇关于使用api调用获取Google工作表过滤器视图数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!