google-spreadsheet-api

How to Search Spreadsheet Using Google Visualization Query

纵然是瞬间 提交于 2019-12-01 13:45:05
I've got this simple webpage which uses google.visualization.Query to pull the values of three specific cells from this spreadsheet , and then sets the values of three corresponding input fields based on their unique id attributes. google.load('visualization', '1', {'packages':['corechart']}); google.setOnLoadCallback(work); function work() { var queryWORK = new google.visualization.Query('https://docs.google.com/spreadsheet/ccc?key=1HpHMfoEnPgESb2XPVCgb7XyGwRAvrq3EoQj4WHj4vhA&sheet=QUERY'); queryWORK.send(handleQueryResponse); } function handleQueryResponse(response) { if (response.isError())

Delete row in Google Sheets if certain “word” is found in cell

自闭症网瘾萝莉.ら 提交于 2019-12-01 12:21:23
问题 I have a Google Sheet with over 3000 rows. Some of the rows contain words that are not relevant..So I need a way to delete these in bulk. For example, cells will contain something like: # | Product ------------------------------- 1 | Cool new product 2 | Old product 3 | Product that's old I want to delete all of the rows that contain the word "old". I found a script that's doing half the job, but it requires the "word" to match the entire cell, not just some of the cell. Line 17 in the code

Delete row in Google Sheets if certain “word” is found in cell

回眸只為那壹抹淺笑 提交于 2019-12-01 11:50:44
I have a Google Sheet with over 3000 rows. Some of the rows contain words that are not relevant..So I need a way to delete these in bulk. For example, cells will contain something like: # | Product ------------------------------- 1 | Cool new product 2 | Old product 3 | Product that's old I want to delete all of the rows that contain the word "old". I found a script that's doing half the job, but it requires the "word" to match the entire cell, not just some of the cell. Line 17 in the code below is what needs to be adjusted: 16 | 17 | if (row[1] == 'old') 18 | Here's the code: /** * Deletes

How to set validation method in Google spreadsheets API

 ̄綄美尐妖づ 提交于 2019-12-01 11:49:42
I am confused about the new Google Sheets API v4. My question is: how can I set validation rules for specified column(s) in spreadsheet? There is no useful tutorial with description how to use appropriate methods. Result should look like following sample: That validation should be set before data upload (which works fine). My current code: $client = getClient(); $service = new Google_Service_Sheets($client); $fileId = 'my-document-id'; $body = new Google_Service_Sheets_SetDataValidationRequest(array( 'setRange' => new Google_Service_Sheets_GridRange( array( 'sheetId'=>'List1',

Getting the cursor row/column from a Google spreadsheet through a Javascript method

拈花ヽ惹草 提交于 2019-12-01 11:10:56
On 29 Mar 2010, Jason Hale wanted to use the spreadsheet cursor location to select an e-mail address for a Javascript app he was writing - See http://productforums.google.com/forum/#!topic/apps-script/U10q44vptPU . Respondents suggested the getActiveSelection and concomitant getRowIndex/getColumnIndex methods. Unfortunately, they didn't work for Hale and they didn't work for me two years later when I wanted to write a similar application. The cursor's location has no effect on getRowIndex and getColumnIndex. These methods always return 1, which is useless and probably a bug. Google Apps lacks

Finding last written row in Google Spreadsheet API

∥☆過路亽.° 提交于 2019-12-01 10:34:21
Is there any way to find the last row you have written in a google spreadsheet in Java? I tried to do that by having a variable which I keep in another file and I update that every time I do another writing. Is there any other way? noogui Finding last written row in Google Spreadsheet API I'll give you a concept first using REST calls but you'll have to apply that in Java. Exceed the range of cells where you're writing. So to find last written row between cells A1:A10, use the range A1:A11 or A1:B (using B means all the rows in cell A will be traversed). Fetch a range of cells, using GET.

How to Search Spreadsheet Using Google Visualization Query

南笙酒味 提交于 2019-12-01 10:05:23
问题 I've got this simple webpage which uses google.visualization.Query to pull the values of three specific cells from this spreadsheet, and then sets the values of three corresponding input fields based on their unique id attributes. google.load('visualization', '1', {'packages':['corechart']}); google.setOnLoadCallback(work); function work() { var queryWORK = new google.visualization.Query('https://docs.google.com/spreadsheet/ccc?key=1HpHMfoEnPgESb2XPVCgb7XyGwRAvrq3EoQj4WHj4vhA&sheet=QUERY');

Google Script: Conditionally copy rows from one spreadsheet to another

倾然丶 夕夏残阳落幕 提交于 2019-12-01 09:22:55
问题 I've found the basic solution https://stackoverflow.com/a/4809413/1438650 but it lacks both the conditional and non-contiguous aspects of my project. I need the the copy to be based on the value of Col G, and then copy columns A, B, & H:S to the other spreadsheet. function movePros() { var date = Utilities.formatDate(new Date, "CST", "yyyy-MM-dd'T'HH:mm:ss'Z'") //"MM/dd/yyyy" var source = SpreadsheetApp.getActiveSpreadsheet(); var target = SpreadsheetApp.openById(

Google App script extracting data from website

随声附和 提交于 2019-12-01 09:15:21
问题 So I am writing a script which look at review done on google+ pages and updates a google spreadsheet. I have found out that the line in the html which holds this value is <span class="A7a">103</span> I just need to make it possible for me to extract from the page with just knowing the URL and that html code. 回答1: Use var response = UrlFetchApp.fetch("http://www.website.com/"); To fetch the html of the page. Then use something like var cut = response.substring( str.indexOf( "<span class="A7a">

How to convert from gid to od* (worksheet id) in new Google spreadsheets

柔情痞子 提交于 2019-12-01 09:01:39
I am using Gdata api to update Google spreadsheet cell. Now New Google spreadsheet has been released and it seems the gid has over 8 digits. The following is sample new sheets and the gid of sheet2 is 1794189920. https://docs.google.com/spreadsheets/d/1S6mvGGoOJa8JF6Qt6GGH5QT-X0HD4EjZhKNbihAwFuE/edit?usp=sharing I tried to convert them with the following method, but doesn't work. How to convert Google spreadsheet's worksheet string id to integer index (GID)? Thanks to anyone who can help shed light on this or suggest. Cheers. Junya All right, this is a ghetto answer because I'm not satisfied