google-spreadsheet-api

How to pass parameter(s) to timed trigger function in library script

半腔热情 提交于 2019-11-29 09:41:38
I have created a function which trigger every after 30 mins, and I want to pass some parameter. I have one library which returns carHistory, and my spreadsheet from where I call library function. Library1.gs function carHistory(number,maker) { // code logic } function startEvery30mins_CarHistory(number,maker) { //This function works carHistory(number,maker); // how to trigger this with parameter. ScriptApp.newTrigger("carHistory") .timeBased() .everyMinutes(30) .create(); } In my SpreadSheet Code.gs : function startOnce(){ Library1.carHistory("US-xxx","Honda"); } function startEvery30mins(){

Java and Google Spreadsheets API Authorization with OAuth 2.0

浪子不回头ぞ 提交于 2019-11-29 07:48:27
I want to read Google Spreadsheets using Java, and the recommended way to do this is using the Google Spreadsheets API . The problem begins when you want to make procedures secure, so they encourage you to use OAuth 2.0. In the official page they show how to do this using only .NET and say that " the Java client library doesn't currently support OAuth 2.0 ", and they give alternatives like using OAuth 1.0 or Client Login using directly email and password . Is this for sure?, isn't there a way to do OAuth 2.0 Authentication through Java, maybe not using directly the Java client library, but

Open Google Docs Spreadsheet by name

笑着哭i 提交于 2019-11-29 06:41:05
I have a situation where a script is taking input data and sending it to a spreadsheet. After a while, this spreadsheet becomes too big. Right now we have to manually move the items from the the primary spreadsheet to a new one. The reason is that not everyone is familiar with the code and are willing to change the ID in the code. I would like to know if there is a way to open the spreadsheet by name. If not, is there a better way of achieving what we need (described above) The DocsList service used in one of the answers no longer functions as it has been depreciated. I updated my scripts to

Why are there two different URL formats for Google spreadsheet documents?

那年仲夏 提交于 2019-11-29 04:52:49
My app accesses private Google spreadsheet documents on behalf of an authorized user. It seems that Google's API expects developers to first request a list of all the spreadsheet documents available to an authorized user before they can get at a particular spreadsheet's keys. I wanted to find a workaround to this, and eventually did by extracting the key parameter value from URLs spreadsheet URLs that look like this: https://docs.google.com/spreadsheet/ccc?key={some long key here}&usp=drive_web#gid=0 It was simple enough to just break down the string to point where I could retrieve key 's

Retrieve rows from spreadsheet data using google app script

蓝咒 提交于 2019-11-28 19:02:11
问题 I am using Google app script to write form data to spreadsheet. Now I would like to fetch the values from Excel which matches conditions (eg., filtered by date, username) and display them with app script. My spreadsheet has +-------------+-----------+----------------------+ | Date | Username | Comment | +-------------+-----------+----------------------+ | 2012-05-02 | palani | My first comment | | 2012-05-02 | raja | My second comment | | 2012-05-03 | palani | My third comment | | 2012-05-03

Accessing older GData APIs (Spreadsheet API) using OAuth 2 and a service account

旧城冷巷雨未停 提交于 2019-11-28 17:37:48
The short question is whether is this possible and if so, how? Outline I have a .NET application which currently uses a service account to access information across a Google Apps domain using the Google Drive API. This works fine using the google-api-dotnet-client library and code along the same lines as shown in the samples here - which are currently a very good basic example of what I'm doing. What I want to do now is extend it so as well as using those APIs provided by the "new" google-api-dotnet-client library, it uses the older "GData" libraries, as provided for via the older google-gdata

How to ask for user input in “on edit” installable trigger in Google Spreadsheet?

柔情痞子 提交于 2019-11-28 13:58:33
When a user edits a cell in particular column to a particular value, messages are sent to a Telegram bot, depending on a new value. This is implemented by an " installable trigger " on edit event . It is installed by the document owner and always runs under that account. There are other users editing the doc and triggering the action. All works fine. Now for some action we need to request a few words from the user who made the edit. But since November 2017 (see issue 68846962 ) "for security reasons" Google restricted their Apps Script and now Ui methods prompt() and showSideBar() are only

HTML select option to be captured from Google Spreadsheet

风流意气都作罢 提交于 2019-11-28 12:59:12
I have been spending days to get over this but no luck. I have a html page in Google script whereby I want a dropdown list - this is achieved as follows <div> <select name="source"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> </div> Now instead of the manual inputs I want the option fields to be captured from a spreadsheet, if the coloumn range increase or decrease the dropdown list should update accordingly. Any workarounds please... Regards, Neel To display the elements in the array

Google Drive API Error Daily Limit for Unauthenticated Use Exceeded

纵然是瞬间 提交于 2019-11-28 12:53:37
Im getting error on using Google API. having right to connect with Google Drive and add new sheet and insert data into it. It was working till yesterday but when i run the application today. Im getting error : Error appears after users given token and tried to access the DRIVE API to get all the files domain: "usageLimits" extendedHelp: "https://code.google.com/apis/console" message: "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." reason: "dailyLimitExceededUnreg" I have not changed any settings. Following API are enables for my application access token. Do i

Export Single Sheet to PDF in Apps Script

吃可爱长大的小学妹 提交于 2019-11-28 11:48:19
I have many sheets in a Spreadsheet. I have 2 sheets that I would like to export every time. Sheet One is a sheet with the information. Sheet Two is the sheet I need to give to customers and it takes references from Sheet One. Currently, I create a new temporary spreadsheet, copy Sheet One to the new spreadsheet, then copy Sheet Two to the temporary spreadsheet. After, I convert the temporary spreadsheet to a pdf. Then I delete the temporary spreadsheet and save the pdf into a folder in Google Drive. The PDF created contains 2 pages of both sheets. I only need Sheet Two. If I only transfer