google-spreadsheet-api

How to import a CSV file using Google Sheets API V4

萝らか妹 提交于 2019-12-03 07:17:15
Background I'm developing a Python 2.7 script that analyzes data from an SQL table and at the end, generates a CSV file. Once the file is generated, I'm logging into my google sheet account and use the import option to import my CSV file into the google spreadsheet The manual labor is kinda stupid and I wish to add this ability to my script. Google Sheets API V4 So, I followed this guide, Python Quickstart and was able to complete all the steps. Then I followed Google Sheets API reference and looked into Method: spreadsheets.create . If I understand correctly, it does not provides the options

Sheet.getRange(1,1,1,12) what does the numbers in bracket specify?

非 Y 不嫁゛ 提交于 2019-12-03 03:41:56
问题 Sheet.getRange(1,1,1,12) I cannot understand the arguments 1,1,1,12 . What is this - the sheet id or row or what? method getRange(row, column, optNumRows, optNumColumns) here what does optNumRows and optNumColumns mean??? 回答1: Found these docu on the google docu pages: row --- int --- top row of the range column --- int--- leftmost column of the range optNumRows --- int --- number of rows in the range. optNumColumns --- int --- number of columns in the range In your example, you would get (if

How do I Authenticate a Service Account to Make Queries against a GDrive Sheet Backed BigQuery Table?

丶灬走出姿态 提交于 2019-12-02 19:13:00
问题 My situation is as follows: Google Account A has some data in BigQuery. Google Account B manages Account A's BigQuery data, and has also been given editor privileges for Account A's Cloud Platform project. Account B has a Sheet in Google Drive that has some cool reference data in it. Account B logs into the BQ Web console, and creates a table in Account A's BQ project that is backed by this sheet. All is well. Account B can query and join to this table successfully within Account A's BQ data

Send range from Google spreadsheet as Email (formatting issue)

烈酒焚心 提交于 2019-12-02 19:00:42
问题 The following code sends out an email for data in columns 2 and 3, however the results in email are not one below another. Code.gs function email() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var bulk = ss.getSheetByName("Bulk"); var lastrow = bulk.getLastRow(); var data1 = bulk.getRange(1, 2, lastrow).getValues(); var data2 = bulk.getRange(1, 3, lastrow).getValues(); var onedata="", twodata=""; for (var i =1; i < data1.length; i++) { if (onedata.length) { onedata += ", "; } onedata +=

Google Java api - error “com.google.gdata.util.ServiceException: Bad Gateway” during feed.insert(entry)

我的未来我决定 提交于 2019-12-02 18:56:31
问题 I am having two worksheets in a spreadsheet. I will copy and change the value from one sheet to other if some conditions are met. It is working for 2 weeks and getting this issue from yesterday. No changes were made. Below mentioned error message is coming when executing this statement. Please note that this error is coming not all the times and also error is coming after iterating some for loops, sometimes when x=10 sometimes when x=100 or x=500 CODE CAUSING THE ERROR: for (int x=1; x <= row

Google Spreadsheets API with OAuth2.0 using Javascript

你离开我真会死。 提交于 2019-12-02 18:30:41
I'm trying to access a private Google Spreadsheet using Javascript. I have sucessfully authorized with OAuth2.0 and can see a listing of all my Google Drive docs. What I can't seem to do is get into a specific spreadsheet. Code is as follows with the relevant spreadsheet code in the function "retrieveAllFiles". A lot of this is culled from Google tutorials. var clientId = 'working'; var apiKey = 'working'; var scopes = 'https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/drive https://spreadsheets.google.com/feeds'; function handleClientLoad() { console.log('inside

Why can't you use setValue in a custom function? [closed]

只愿长相守 提交于 2019-12-02 13:12:17
I'm really just curious, but does anyone know why you can't use setValue to write in different cell in a custom function? The readme explains that you can't do this, but doesn't give a reason on why: link Custom functions return values, but they cannot set values outside the cells they are in. In most circumstances, a custom function in cell A1 cannot modify cell A5. However, if a custom function returns a double array, the results overflow the cell containing the function and fill the cells below and to the right of the cell containing the custom function. You can test this with a custom

How to get a data range of the Sheet

不羁的心 提交于 2019-12-02 10:48:10
问题 I need to get a data range of the Sheet. I must call APIs twice. GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/Sheet1?majorDimension=ROWS // Height is result.length GET https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}/values/Sheet1?majorDimension=COLUMNS // Width is result.length But I do not need data, I only need the size of the data range. Is there a way to get that? 回答1: Unfortunately, I couldn't find the method for directly retrieving "the size of

Hide Sheets with Google PHP SpreadSheets client

只谈情不闲聊 提交于 2019-12-02 09:17:15
问题 I am using the following code to hide some sheets of a spreadsheet. I use php client library. My target is to export only the desired sheets into a PDF file. Since there is not method to achieve that, I am trying to hide the undesired sheets and then export the spreadhseet with the sheet I need to send by email. But all there requests are failing. Anyone knows the reason? Thank you! function hideSheets($spreadsheetId, $sheetIds) { // Get the sheet service. global $sheet_service; $requestBody

How do I Authenticate a Service Account to Make Queries against a GDrive Sheet Backed BigQuery Table?

醉酒当歌 提交于 2019-12-02 08:17:21
My situation is as follows: Google Account A has some data in BigQuery. Google Account B manages Account A's BigQuery data, and has also been given editor privileges for Account A's Cloud Platform project. Account B has a Sheet in Google Drive that has some cool reference data in it. Account B logs into the BQ Web console, and creates a table in Account A's BQ project that is backed by this sheet. All is well. Account B can query and join to this table successfully within Account A's BQ data from the web UI. Problem: Google Account A also has a service account that is an editor for Google