google-spreadsheet-api

How to access Spreadsheet from a Google Forms submit trigger function

两盒软妹~` 提交于 2019-12-11 02:12:28
问题 I have a function in Google Forms script to add a Unique ID to the row being added to the associated Sheet. This function is triggered on submission of the form. Here's one version of the script I've been playing around with:- function onFormSubmit(e) { // Get the active sheet var sheet = SpreadsheetApp.getActiveSheet(); // Get the active row var row = sheet.getActiveCell().getRowIndex(); // Get the next ID value. var id = sheet.getRange("Z4").getValue(); // Check of ID column is empty if

Why is my Jquery ajax success handler being called with an array (and not the response object)

最后都变了- 提交于 2019-12-11 01:34:27
问题 I have a function which makes two rest calls to the google spreadsheetAPI. I use a $.when to make sure that the data fron thefirst call is process before dealing with the data from the second call. The problem is that the first ajax handler(getRealNames), receives a javascript object as its argument, but the second handler(displayTeams), receives an array, the 0th element is the object I was expecting to get. Why does one get an object and the other get an array? They are calling the same

How could I get the link of an specific sheet with Google script?

穿精又带淫゛_ 提交于 2019-12-11 00:33:22
问题 I have a spreadsheet with many sheets. Each sheet is a report and has a different link. How could I get the link of this active sheet? Eg: Output > The link of the report is available here. 回答1: Your 'here' link doesn't work, however, in lieu of that, it is possible to create a public hyperlink to a specific sheet. When you open the Google Sheet and navigate the sheets in your browser, you will notice that there is an anchor element to the URL that is #gid=some_number . Appending that same

Error while 'writing' into a google spreadsheet using Google API

只谈情不闲聊 提交于 2019-12-10 21:49:09
问题 Code used var values = [ [ 'value1','value2','value3' ] ]; var body = { values: values }; gapi.client.sheets.spreadsheets.values.update({ spreadsheetId: '1Lofhq9R7X5wzGvO7fMViN8D8q1W3fiNxO5jjP7XL_s0', range: 'Sheet1!A1:A4', valueInputOption:'RAW', resource: body }).then((response) => { var result = response.result; console.log(`${result.updatedCells} cells updated.`); }); Error shown { "error": { "code": 400, "message": "Invalid JSON payload received. Unknown name \"valueInputOption\": Cannot

get Google client using access token

≡放荡痞女 提交于 2019-12-10 21:28:35
问题 I already stored the access and refresh token in my database. I want get the google client using that. I don't know how to use it in below example $client = Zend_Gdata_ClientLogin::getHttpClient('you@there.com', 'password', Zend_Gdata_Spreadsheets::AUTH_SERVICE_NAME); $service = new Zend_Gdata_Spreadsheets($client); // Get worksheet feed $query = new Zend_Gdata_Spreadsheets_DocumentQuery(); $query->setSpreadsheetKey('your spreadsheet key'); $feed = $spreadsheetService->getWorksheetFeed($query

Google Sheet API append to a specific sheet

喜你入骨 提交于 2019-12-10 20:06:32
问题 according to the API it seems that I can't specify the sheet where to append the data. It appends everything in the first sheet. Is it really like this? Beacuse I can create a file with multiple sheets, but then I can't write on the second sheet? 回答1: If you simply want to write on a sheet, follow the Basic Writing Sheets guide. You can write on a sheet by using a PUT method: PUT https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/Sheet1!A1:D5?valueInputOption=USER_ENTERED and

Is there a way to add a row on a Google Spreadsheet without OAuth using java?

喜欢而已 提交于 2019-12-10 17:24:55
问题 I've searched a lot of websites about how to do that using only the spreadsheet key, but with no success. I can retrieve it, get all the data I want, but I can't append a new row to it. I've already published my spreadsheet to the web and made it public but I keep getting " com.google.gdata.util.ServiceException: Method Not Allowed". That's how I'm trying to do it: SpreadsheetService service = new SpreadsheetService("MySpreadsheetIntegration-v1"); try { URL url = FeedURLFactory.getDefault()

Google sheet api integration geetin error like InterruptedException

大城市里の小女人 提交于 2019-12-10 12:03:56
问题 i want to integrate google sheet api in my application so i use following link https://developers.google.com/sheets/quickstart/android and i follow all steps for that and i want to call spreadsheet below link https://docs.google.com/spreadsheets/d/17Rdom3QF21uTbp89ZTXqjL8CmUGyoCvxJ5Hnc7wVqjk/edit#gid=0 I change my code as per below function private List<String> getDataFromApi() throws IOException { String spreadsheetId = "17Rdom3QF21uTbp89ZTXqjL8CmUGyoCvxJ5Hnc7wVqjk"; String range = "Sheet1!B

Reference file in Google drive in Google Spreadsheet

假装没事ソ 提交于 2019-12-10 11:15:36
问题 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] 回答1: Yes its possible. Google for 'host website on google drive' for detailed instructions. Basically first share the folder as

How do I Hide a sheet?

谁说胖子不能爱 提交于 2019-12-10 11:04:17
问题 How do I hide some sheets in a spreadsheetApp with googleScript? I have a spreadsheet with multiple sheets, and I want to reduce the spreadsheet to only the first visible sheet and all the other hidden, using googlScript 回答1: sheet.hidesheet() It's been added. 回答2: I too am looking for that same answer. As far as I can tell SpreadsheetApp, Spreadsheet and Sheet classes dont have any Hide/Unhide methods. However I use the following code to set sheet protection on all sheets in a spreadsheet,