google-spreadsheet-api

How to read a spreadsheet using Google Sheets API + Javascript

≡放荡痞女 提交于 2019-12-25 18:36:26
问题 There's a nice solution to updating Google spreadsheets using the Drive REST API in this question. It overwrites the current contents. I'd like to read in the current contents, modify them, then update. How do I read in the current spreadsheet? 回答1: This works (assuming your credentials are in order and you are authorized): function getFileInfo(fileId, callback) { try { gapi.client.drive.files.get({ fileId: fileId, fields: "appProperties,capabilities,contentHints,createdTime,description

Inserting data into different sheets in Google Sheet

浪尽此生 提交于 2019-12-25 17:38:21
问题 I try create in google sheet form to inserting data into several sheets at once. When you open the form you have field for entering some values and Checkbox where you can select a sheet to enter data. I have a question, how can I make data to be written to several sheets at once? Below my code. <b>test 1.1</b><br /> <br> <form> <br> Nr item:<br> <input id="NrItem" name="NrItem" type="text" /> <br> <br> <input name="choices" type="checkbox" value="something1" /> sheet1 <br> <br> <input name=

Google Sheets API V4 - Autofill Error - No grid with id: 0

孤人 提交于 2019-12-25 12:04:20
问题 I am trying to make an AutoFillRequest using a SourceAndDestination object to describe the area to autofill. I've tested autofill requests using a GridRange object and everything works fine, but can't seem to get the SourceAndDestination working. Here is an example where I'm trying to autofill down the first row for 2 more rows. HTTP POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}:batchUpdate Request Body { "requests": [ { "autoFill": { "sourceAndDestination": { "dimension"

Google Sheets API V4 - Autofill Error - No grid with id: 0

会有一股神秘感。 提交于 2019-12-25 12:04:10
问题 I am trying to make an AutoFillRequest using a SourceAndDestination object to describe the area to autofill. I've tested autofill requests using a GridRange object and everything works fine, but can't seem to get the SourceAndDestination working. Here is an example where I'm trying to autofill down the first row for 2 more rows. HTTP POST https://sheets.googleapis.com/v4/spreadsheets/{spreadsheetId}:batchUpdate Request Body { "requests": [ { "autoFill": { "sourceAndDestination": { "dimension"

How to index array's in Google Apps Script?

寵の児 提交于 2019-12-25 09:15:41
问题 I was working on this project and I wanted to make a function that displays an element of a specific column. Now with javascript I can call any element of an array with Array[i] But for some reason this doesn't seem to work in Google Spreadsheets. var MyFunction(A) { return A[1]; } This function yields me nothing. EDIt: I solved it. I used this loop with a sort of double indexing: for (var i=0; i < 37; i++) { if (A[0][i] < max && A[0][i] != 0) { var max = A[0][i]; }; }; A[0][0] is the first

import private google fusion table to google docs spreadsheet

 ̄綄美尐妖づ 提交于 2019-12-25 07:57:53
问题 I want to build a chart to google fusion table. I know there is an option to do it with fusion table but I need to do that using google spreadsheet. How do I import a private fusion table to a spreadsheet? function getdata(authToken) { query = encodeURIComponent("SELECT * FROM tableid"); var URL = "http://www.google.com/fusiontables/api/query?sql=" + query; var response = UrlFetchApp.fetch(URL, { method: "get", headers: { "Authorization": "GoogleLogin auth=" + authToken, } }); return response

Counting duplicate cells on multiple rows and columns with Google Spreadsheet

一曲冷凌霜 提交于 2019-12-25 07:01:02
问题 So with Google Apps Script, I have a spreadsheet as following: A B C... apple banana orange... banana orange grape... banana apple orange... ... ... ... ...and I want to make it like this: apple 2 banana 3 grape 1 orange 3 What would be the easiest way to make this possible? I have tried to use query function on Google Apps Spreadsheet, but since there are multiple columns it is difficult to sort and count. I have also tried to use join and countif function but it tend to get redundant since

How get json Respone from Guzzle, post protected google spread sheet

吃可爱长大的小学妹 提交于 2019-12-25 04:24:48
问题 How to get response when I post request with Guzzle I use "guzzle/guzzle": "^3.9", $guzzle = new Client(); $postCell = $guzzle ->post('https://sheets.googleapis.com/v4/spreadsheets/' . $spreadsheetId . ':batchUpdate', [], $addProtectedRangeJson ) ->addHeader('Authorization', 'Bearer ' . $arrayAccessTokenClient) ->addHeader('Content-type', 'application/json') ; $postCell ->send() ->getBody(true) ; $contents = (string) $postCell->getBody(); // get body that I post -> my request, not response

How to query a Google spreadhseet via spreadhseet api v3?

旧街凉风 提交于 2019-12-24 22:38:13
问题 I have a very large spreadsheet filed with music metadata. I have wrote a program to pull an individual album, via the spreadsheet api from Google, based on the albums UPC code. It does this though a loop, pulling one cell at a time and comparing. It is very slow, it takes 6 seconds for a 12 track album. In attempt to make this program faster, I found an argument called "structured query" in a Google article, but I cannot get it to work. Here are the queries I have tried. Structured query

How to upload xlsx files to my own google drive, then convert them to google spreadsheet and get the shareable link programmatically?

为君一笑 提交于 2019-12-24 14:46:13
问题 I'm working on a node.js server. I want to upload and convert .xlsx files to google spreadsheet in my own google drive and then get the shareable link programmatically. However, I found google drive api is specialized for building app for other users to access their drives to do something on your app but not for accessing your own drive programmatically. Do I understand this correctly? I have read a lot of documents on google developers and some tutorial about this but I cannot find the way