google-spreadsheet-api

Google Sheets API v4 - How to get the last row with value?

南楼画角 提交于 2019-11-28 11:20:16
How to get the last row with value in the new Google Sheets API v4 ? i use this to get a range from a sheet: mService.spreadsheets().values().get("ID_SHEET", "Sheet1!A2:B50").execute(); how to detect the last row with value in the sheet ? You can set the range to "A2:D" and this would fetch as far as the last data row in your sheet. I managed to get it by counting the total rows from current Sheets. Then append the data to the next row. rowcount = this.mService.spreadsheets().values().get(spreadsheetId, range).execute().getValues().size() You don't need to. Set a huge range (for example A2

AccessTokenRefreshError: Google Spreadsheet API with oAuth 2.0 Service Account of App Engine App

若如初见. 提交于 2019-11-28 10:38:58
I'm trying to access a Google Spreadsheet via the GData API using oAuth 2.0 service-account credentials created for a Python 2.7 app hosted on Google App Engine. The app uses the recent gdata-python-client from Google, v. 2.0.18 (gdata and atom). The app uses the recent google-api-python-client-gae, v. 1.2. In the Google Developer Console for this project (in this example referred to as "my-gae-app"), I have created a Service Account and delegated domain-wide authority to the service account as described here The desired spreadsheet in Google Drive belongs to a Google Apps for Work domain,

Google Spreadsheet to pdf with watermark in Google script

筅森魡賤 提交于 2019-11-28 10:23:18
问题 I want to convert the spreadsheet with a watermark/background image, and send + save the generated pdf The converting to pdf worked, but I don't know if/how you can put an image to the generated pdf. This is what i got now: function ExportAndSent(subject, filename, email) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var message = "A message"; var tempSpreadsheet = SpreadsheetApp.create(filename); var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); sheet = ss

How to get a note or comment

ぐ巨炮叔叔 提交于 2019-11-28 09:16:33
问题 I have an Excel containing cell comments/notes, I've uploaded it to Google Drive, and converted it into a Google Spreadsheet. How may I retrieve the comments for cell A1? The API doesn't describe how to get a note or comment from a cell. 回答1: The Google Apps Spreadsheet API only provides programmatic access to spreadsheet data. You cannot access comments using the API. You can get the Notes for a cell or range of cells using Google Apps Script. See the Class Range documentation for these

What is an example of using OAuth 2.0 and Google Spreadsheet API with Java?

你。 提交于 2019-11-28 06:56:17
Where is example code showing how to use the Google Data Java Client Library and its support for OAuth 2.0 with the Google Spreadsheet API (now called the Google Sheets API )? Answer moved from original question to match site "Q and A" format. The Google Data Java Client Library supports OAuth 2.0 . Unfortunately, there are no complete samples in the library showing how to use it with the Google Spreadsheet API . Here is an example that has worked for me. I hope someone find it helpful. import com.google.api.client.auth.oauth2.Credential; import com.google.api.client.googleapis.auth.oauth2

Google Docs Spreadsheet to JSON

半腔热情 提交于 2019-11-28 06:33:54
I've seen numerous articles on this but they seem outdated, for instance none of the Google Docs Spreadsheet urls has key parameter. I read this as well: JSON data from google spreadsheet Then I read this to access data https://developers.google.com/gdata/samples/spreadsheet_sample My spreadsheet exists at: https://docs.google.com/spreadsheets/d/1SKI5773_68HiSve1fsz7fr4gotjFWHB7KBuVsOlLz6I/edit#gid=0 I've tried using this code, I think I have a problem with the key or syntax, please guide to fix. <script src="http://spreadsheets.google.com/feeds/feed/1SKI5773

“PERMISSION_DENIED” on Google Spreadsheet REST API v4

旧城冷巷雨未停 提交于 2019-11-28 05:14:43
问题 I try to read data from google sheet via http. I use v4 google spreadsheet api: https://sheets.googleapis.com/v4/spreadsheets/1MZJEOzkzy5iJ9HPy2GU-Ky3vdaIzGGDQH8BMt4n3OGI/values/Sheet1!A1:D5 I get: { "error": { "code": 403, "message": "The request cannot be identified with a client project. Please pass a valid API key with the request.", "status": "PERMISSION_DENIED" } } Sheet is published online and everyone can edit it. It works on api v3 too. 回答1: First, make sure you have a permission to

Chrome Extension Writing to Google Spreadsheet [closed]

我与影子孤独终老i 提交于 2019-11-28 05:01:53
I've been doing some research and for some reason can't find a good example showing this anywhere, and I am starting to wonder if it's even possible. What's I'm looking to do is to have my extension write data within a Google Spreadsheet, so that the sheet is being used as a database. Does anyone have any documentation that I could follow through? Considering that the Spreadsheet API doesn't seem to allow JavaScript, is that even possible? THanks. Ohhh Yes, it is definitely possible. I have used the Spreadsheet API extensively using Javascript. You'll need to use the Protocol version of the

How do I create a Google Spreadsheet with a service account and share to other google users in java?

亡梦爱人 提交于 2019-11-28 04:35:19
I have an application where I, with a Google Service Account , gather lots of information about my site from the Analytics API. My next step is to create a spreadsheet with the service account and share the document with a couple of users. I have checked out the documentation at https://developers.google.com/google-apps/spreadsheets/ but I can't find anything there about service accounts and sharing the documents. So my first question is this possible? If not do I need to implement the "use my personal account" as exemplified in the documentation? If yes could you please provide me with an

How to pass parameter(s) to timed trigger function in library script

帅比萌擦擦* 提交于 2019-11-28 03:21:28
问题 I have created a function which trigger every after 30 mins, and I want to pass some parameter. I have one library which returns carHistory, and my spreadsheet from where I call library function. Library1.gs function carHistory(number,maker) { // code logic } function startEvery30mins_CarHistory(number,maker) { //This function works carHistory(number,maker); // how to trigger this with parameter. ScriptApp.newTrigger("carHistory") .timeBased() .everyMinutes(30) .create(); } In my SpreadSheet