google-spreadsheet-api

How do I export the revision history of a gdoc to git?

我的未来我决定 提交于 2020-12-27 08:06:48
问题 I have a spreadsheet in google docs that I'd want to integrate in a git workflow (and push to github). Are there any tools (or even libraries that are gdoc version aware) that do, or help me do, that? I have some old ruby hacks lying around based on the google_spreadsheet gem that reads and writes current versions of a csv gdoc, but nothing which extracts revision history. 回答1: gdoc is not set up for exporting revision history source. Google drive does have an API to access all the revisions

Looping through multiple google spreadsheets with google scripts

爷,独闯天下 提交于 2020-12-26 04:37:18
问题 So I have multiple different spreadsheets inside of google drive (completely different files, not in the same file and different sheets), and I've been trying to figure out a way to pull data from all of the spreadsheets and populate one main sheet. But the problem I've been trying to figure out is that I can't seem to find a way to loop through all the spreadsheets. I've read a suggestion on another similar question in which they said to create a different spreadsheet that stored all the

Looping through multiple google spreadsheets with google scripts

旧城冷巷雨未停 提交于 2020-12-26 04:35:20
问题 So I have multiple different spreadsheets inside of google drive (completely different files, not in the same file and different sheets), and I've been trying to figure out a way to pull data from all of the spreadsheets and populate one main sheet. But the problem I've been trying to figure out is that I can't seem to find a way to loop through all the spreadsheets. I've read a suggestion on another similar question in which they said to create a different spreadsheet that stored all the

Looping through multiple google spreadsheets with google scripts

烈酒焚心 提交于 2020-12-26 04:32:35
问题 So I have multiple different spreadsheets inside of google drive (completely different files, not in the same file and different sheets), and I've been trying to figure out a way to pull data from all of the spreadsheets and populate one main sheet. But the problem I've been trying to figure out is that I can't seem to find a way to loop through all the spreadsheets. I've read a suggestion on another similar question in which they said to create a different spreadsheet that stored all the

Download/Export Public Google Spreadsheet as TSV from Command Line?

孤街醉人 提交于 2020-07-17 07:18:25
问题 I have a public (published) Google spreadsheet that I’m trying to download programmatically in TSV form. In my browser, with a Google login active, for some actual key $key , https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=$key&exportFormat=tsv works and produces a TSV file. In my shell, however: curl -L "https://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=$key&exportFormat=tsv" produces a bunch of javascript. curl -L "https://spreadsheets.google.com

How to delete row in Google Sheet if “Column A” cell CONTAINS given text

允我心安 提交于 2020-03-22 09:14:09
问题 I am trying to implement a Google Script so that if any cell in column A INCLUDES any specified text, then it will delete the entire row. Here is what i'm working with... function onEdit() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = ss.getSheetByName('Sheet1'); // change to your own var values = s.getDataRange().getValues(); for (var row in values) if (values[row][0] == 'glass') s.deleteRow(parseInt(row)+1); else if (values[row][0] == 'Glass') s.deleteRow(parseInt(row)+1); }; I

How to delete row in Google Sheet if “Column A” cell CONTAINS given text

我怕爱的太早我们不能终老 提交于 2020-03-22 09:12:21
问题 I am trying to implement a Google Script so that if any cell in column A INCLUDES any specified text, then it will delete the entire row. Here is what i'm working with... function onEdit() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = ss.getSheetByName('Sheet1'); // change to your own var values = s.getDataRange().getValues(); for (var row in values) if (values[row][0] == 'glass') s.deleteRow(parseInt(row)+1); else if (values[row][0] == 'Glass') s.deleteRow(parseInt(row)+1); }; I

Java Epoch Date for Google SpreadSheet

有些话、适合烂在心里 提交于 2020-01-25 19:58:09
问题 I tried to add date on Google spreadsheet. To add date we have convert date in epoch. For Spreadsheet epoch Google Sheets uses a form of epoch date that is commonly used in spreadsheets. The whole number portion of the value (left of the decimal) counts the days since December 30th 1899. The fractional portion (right of the decimal) counts the time as a fraction of one day. For example, January 1st 1900 at noon would be 2.5, 2 because it's two days after December 30th, 1899, and .5 because

Google Calendar App Script to pull Data into a Spreadsheet periodically

≯℡__Kan透↙ 提交于 2020-01-22 16:30:26
问题 I've been using this script to pull Data from Google Calendar into a spreadsheet. I have a couple questions for improvements: Is it possible to have this pull data from multiple calendars to the same spreadsheet without them overwriting each other? Is it possible to have it add a new column of data to the spreadsheet that marks which calendar each row came from? Also, how would you go about setting this up to run automatically every 24 hours? THANKS! function caltest3(){ var ss =

How to set validation method in Google spreadsheets API

大城市里の小女人 提交于 2020-01-21 09:55:47
问题 I am confused about the new Google Sheets API v4. My question is: how can I set validation rules for specified column(s) in spreadsheet? There is no useful tutorial with description how to use appropriate methods. Result should look like following sample: That validation should be set before data upload (which works fine). My current code: $client = getClient(); $service = new Google_Service_Sheets($client); $fileId = 'my-document-id'; $body = new Google_Service_Sheets