Get google sheet filter view data with api call

天大地大妈咪最大 提交于 2021-02-05 07:48:06

问题


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"
    }
)

回答1:


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.



来源:https://stackoverflow.com/questions/58923823/get-google-sheet-filter-view-data-with-api-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!