google-spreadsheet-api

How to upload a file to Google Drive using Service Account in PHP?

半世苍凉 提交于 2019-12-06 08:06:28
Quickstart: Run a Drive App in PHP seems to be using an outdated version of [google-api-php-client][2], also it doesn't provide example on how to upload a file using Service Account. In my project I'll need to add a file (spreadsheet) using Service Account, add a spreadsheet, share the spreadsheet with another user and add rows to the spreadsheet. I'm able to get an empty list of spreadsheets, but I couldn't figure it out how to upload a file using Service Account. The PHP Class google-api-php-client/examples/spreadsheet.php: <?php use Google\Spreadsheet\DefaultServiceRequest; use Google

Delayed Execution on Edit with Google Apps Script

六眼飞鱼酱① 提交于 2019-12-06 08:04:34
I have a relatively large spreadsheet (300 rows, 30 columns) that I color based on the values in the spreadsheet. I'm doing accessing the API minimally using only two accesses: getValues(...) to access all the values of the data range. setBackgrounds(...) to set all the backgrounds of the data range. This runs in about half a second or less. However, it gets in the way if I make it run on every edit using onEdit() , but I also don't want it to be updated at regular time intervals when I'm not editing it, seems like a waste. Is there a good way to make the script run in a "delayed" way,

Reference file in Google drive in Google Spreadsheet

回眸只為那壹抹淺笑 提交于 2019-12-06 07:27:15
I have created a folder in Google Drive, e.g. test, and put 3 files inside it a.jpg, b.jpg, c.jpg I want in my Google Spreadsheet under the same account, to access the files, e.g. generate the link to image file, is it possible? e.g. ColA ColB a.jpg [generate link to a.jpg in drive] a.jpg [generate link to b.jpg in drive] a.jpg [generate link to c.jpg in drive] Yes its possible. Google for 'host website on google drive' for detailed instructions. Basically first share the folder as public, copy the folder id from its url and make a new url googledrive.com/host/folderid/a.jpg With GScripts you

Gspread keep alive after update google auth2

血红的双手。 提交于 2019-12-06 07:20:15
There are several examples for 'keep the connection with google spreadsheet alive' But all I found are based on the 'old' Google Sign-In system which isn't work anymore since april 2015 What is the proper methode to keep the connection with googlespreadsheet alive using OAuth 2.0 I've Tried this import gspread from oauth2client.service_account import ServiceAccountCredentials headers = gspread.httpsession.HTTPSession(headers={'Connection':'Keep-Alive'}) #Allows a persistant connection. scope = ['https://spreadsheets.google.com/feeds'] credentials = ServiceAccountCredentials.from_json_keyfile

How to create a list range validation using the Android Google Spreadsheet API

本秂侑毒 提交于 2019-12-06 04:19:19
I am creating an android application that creates a new Spreadsheet in Google Drive and inserts some data inside. Currently I can insert free Text and Formulas, but I need to add some specific validations and specifically a drop down list with predefined values. The expected result should be something like this: I am using this code: SpreadsheetFeed feed = spreadsheetService.getFeed( FeedURLFactory.getDefault() .getSpreadsheetsFeedUrl(), SpreadsheetFeed.class); // Creating the list of spreasheets in GDrive List<com.google.gdata.data.spreadsheet.SpreadsheetEntry> spreadsheets = feed.getEntries(

google spreadsheet API v4 - Find value

本秂侑毒 提交于 2019-12-06 03:24:16
How can i search a google spreadsheet using new api v4. In the api docs i found find/replace , but it can't find cells, it only replaces cells. So is there any method to find a value in a google spreadsheet other than brute-force method of fetching all data and searching in it? This is a little bit of a kludge, but I create a cell using the API with this formula to search a specified column in a sheet: =ADDRESS(MATCH("SEARCHSTRING",A1:A999),2) This does mean I have to make three different calls (write, read, and clear) and it only works on a single column or row, but I find it useful for large

Updating cell in Google Spreadsheets returns error “Missing resource version ID” / “The remote server returned an error: (400) Bad Request.”

大兔子大兔子 提交于 2019-12-06 01:01:33
I would like to update a cell value in Google Spreadsheets but unfortunatelly an error is received: Google.GData.Client.GDataRequestException was unhandled HResult=-2146233088 Message=Execution of request failed: https://spreadsheets.google.com/feeds/cells/1nW8nxoS2l9pbj6dctreEfKHNXmsfbbsCAvOd7TIj4Bo/od6/private/full/R1C1 Source=Google.GData.Client ResponseString=Missing resource version ID StackTrace: at Google.GData.Client.GDataRequest.Execute() ... at System.Threading.ThreadHelper.ThreadStart() InnerException: System.Net.WebException HResult=-2146233079 Message=The remote server returned an

Fuzzy match on google sheets

不羁岁月 提交于 2019-12-05 23:01:45
I'm trying to fuzzy match two columns in google sheets, i've tried numerous formulas but I think it's going to come down to a script to help out. I have a column with product ID's e.g. E20067 and then I have another sheet with another column which has image url's relating to this product code such as http://wholesale.test.com/product/E20067/web_images/E20067.jpg http://wholesale.test.com/product/E20067/high_res/E20067.jpg http://wholesale.test.com/product/E20067/high_res/E20067-2.jpg What I'm wanting to do is "fuzzy" match both of these columns for their product ID, and then create a new

Google spreadsheets API C# missing resource version id on batch update

对着背影说爱祢 提交于 2019-12-05 21:43:21
I'm trying to batch update the empty cells using the spreadsheets api C# v2.2.0.0 this way: foreach (var csvline in csv) { var csvlineParsed = csvline.Split(';'); for (uint index = 0; index < csvlineParsed.Length; index++) { var cellEntry = new CellEntry(i, index + 1, csvlineParsed[index]); cellFeed.Insert(cellEntry); var cell = new CellEntry(i, index + 1); cell.Id = new AtomId(string.Format("{0}/{1}", cellFeed.Self, "R" + i + "C" + index + 1)); cell.InputValue = csvlineParsed[index]; cell.BatchData = new GDataBatchEntryData("R" + cell.Row + "C" + cell.Column, GDataBatchOperationType.update);

How to get Taiwan Stock Exchange Index in google spreadsheet

自作多情 提交于 2019-12-05 21:24:01
How to get Taiwan Stock Exchange Index in google spreadsheet? This index do exist in google finance under https://www.google.com/finance?q=TPE%3ATAIEX I tried the following formula, but all of them are failed. =GoogleFinance("TPE:TAIEX"; "price") =GoogleFinance("TPE.TAIEX"; "price") =GoogleFinance("TAIEX.TW"; "price") =GoogleFinance("TAIEX:TPE"; "price") =GoogleFinance("TAIEX.TPE"; "price") =GoogleFinance("TPE%3ATAIEX"; "price") xpawn =GoogleFinance("TWII"; "price") I can propose you 2 work around: The appscript trick: build a google apps script to retrieve the data from your favorite site.