google-spreadsheet-api

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

梦想与她 提交于 2019-12-02 07:42:08
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_TODAY_WS;x++){ for(int y=1; y <= col_TODAY_WS;y++){ CellEntry newEntry = new CellEntry (x, y, feed

Hide Sheets with Google PHP SpreadSheets client

我的梦境 提交于 2019-12-02 06:16:22
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 = new Google_Service_Sheets_BatchUpdateSpreadsheetRequest(); $requests = array(); foreach ($sheetIds as

Programmatically get a Spreadsheet “Publish[ed] on the web”

佐手、 提交于 2019-12-01 23:56:19
For the time being I believe this is a real wall I'm hitting my head on, but let's try: Is there any way to programmatically set a spreadsheet to "Publish[ed] on the web" via GAS, or using any of the Google APIs (Google Spreadsheets, Google Docs List, etc.) and UrlFetch? The goal is to access the sheet feed anonymously. Please note that it is possible to make a sheet "public" (through the Google Docs List: it's a "sharing" option), or using GAS setAnonymousAccess() I think, but as far as I know, not "published", which is a different cup of tea (it's set manually through "File->Publish on the

Dynamic Sheet Name in Query in Google Spreashsheet

孤街浪徒 提交于 2019-12-01 22:19:07
In Google spreadsheet I want to query data in another sheet but the problem is that the name of sheet is present in a cell. So is there a way in QUERY function to dynamically mention sheet name. Basically I am trying to do something like this but with dynamic sheet name: =QUERY('2012'!A2:F;"select C, sum(F) where A='December' group by C order by sum(F) desc") I tried to do this but I get Parse Error: =QUERY(INDIRECT("Overview!L5")!A2:F;"select C, sum(F) where A='December' group by C order by sum(F) desc") In which Overview!L5 is the cell with sheet name to query. I also tried to concatenate

If cross domain ajax calls are not allowed then how are you supposed to use the google spreadsheet API

给你一囗甜甜゛ 提交于 2019-12-01 20:24:40
问题 If cross domain ajax calls are not allowed then how are you supposed to do this? Note: obsoleted link. Question updated with relevant section from original page in question. From link; (Developer's Guide: Protocol v 2.0 – Google Spreadsheets API): Add a row To add a row to the table, start by creating an <entry> element containing the relevant data: <entry> <gsx:hours>1</gsx:hours> <gsx:ipm>1</gsx:ipm> <gsx:items>60</gsx:items> <gsx:name>Elizabeth Bennet</gsx:name> </entry> Then determine the

If cross domain ajax calls are not allowed then how are you supposed to use the google spreadsheet API

五迷三道 提交于 2019-12-01 20:10:23
If cross domain ajax calls are not allowed then how are you supposed to do this ? Note: obsoleted link. Question updated with relevant section from original page in question. From link; (Developer's Guide: Protocol v 2.0 – Google Spreadsheets API): Add a row To add a row to the table, start by creating an <entry> element containing the relevant data: <entry> <gsx:hours>1</gsx:hours> <gsx:ipm>1</gsx:ipm> <gsx:items>60</gsx:items> <gsx:name>Elizabeth Bennet</gsx:name> </entry> Then determine the appropriate URL to send the entry to, known as the POST URL . You can find the POST URL in the list

ExceptionInInitializerError in Android app?

跟風遠走 提交于 2019-12-01 19:36:08
问题 In my Android app the WebView activity class has following line, webView.addJavascriptInterface(new JSInterface(this), "Android"); And in JSInterface class, I'm initializing Google "SpreadSheetService" like below, import com.google.gdata.client.spreadsheet.SpreadsheetService; --- some more imports --- public class JSInterface { Context mContext; public SpreadsheetService service; /** Instantiate the interface and set the context */ JSInterface(Context c) { mContext = c; service = new

Extend Google Spreadsheets UI with a Google Web App

只愿长相守 提交于 2019-12-01 18:36:49
I created a script for Google Spreadsheets, this script just adds a new menu item as described here Custom Menu Items in a Spreadsheet . Then I deploy this script as a Web App and I want all users who install the app to be able to see the new menu item. And I'm stuck at this point. As I understand, when you deploy a script as a Web App, onOpen functions looses it's meaning. So, inside doGet I create custom trigger for onOpen event, attach myOnOpen handler to it and inside myOnOpen I add a menu item, but the item doesn't show up. Here's my code: function doGet() { var newSheet = SpreadsheetApp

ExceptionInInitializerError in Android app?

北战南征 提交于 2019-12-01 18:07:36
In my Android app the WebView activity class has following line, webView.addJavascriptInterface(new JSInterface(this), "Android"); And in JSInterface class, I'm initializing Google "SpreadSheetService" like below, import com.google.gdata.client.spreadsheet.SpreadsheetService; --- some more imports --- public class JSInterface { Context mContext; public SpreadsheetService service; /** Instantiate the interface and set the context */ JSInterface(Context c) { mContext = c; service = new SpreadsheetService("List Demo"); } ------- some more code ----- When I run the application I'm getting the

Google Spreadsheets script to delete any rows where a string is found

匆匆过客 提交于 2019-12-01 14:16:20
I need to loop through all rows/columns in a sheet and remove rows contain certain words. Ideally, I would search through the sheet using a regular expression, but just finding a string would help get me moving. I'm seeing a lot of posts on Stack Overflow about finding and deleting empty rows, but can't find anything about searching an entire sheet and deleting a row if found. This is what I have so far: /* Delete rows */ function deleteRows() { var sheet = SpreadsheetApp.getActiveSpreadsheet(); var rows = sheet.getDataRange(); var numRows = rows.getNumRows(); var values = rows.getValues();