Use for questions about Google Apps Script, Google's JavaScript-based cloud scripting language for automating tasks across Google products and third party services.

learn more… | top users | synonyms

1
vote
0answers
9 views

Advanced Service Classroom is not working from yesterday

I have been working on a project the last few days that access advanced services, specifically Classroom. The project has the advanced services enabled -classroom- and also in the "Google Developer ...
0
votes
1answer
13 views

Optimizing google apps script for replacing/appending values

I have a function that loops through array C:D to find a match in A:B, if there is it replaces the value in B with D and if there's no match it appends C:D to A:B. This function is using loops. I know ...
0
votes
1answer
12 views

“Action not allowed” - Even for empty functions

I have a Google App Script I created from a Google Form. I have it published as an API executable and it's worked fine for the past few weeks. Suddenly, I can't call any functions from Google App ...
0
votes
1answer
12 views

Spreadsheet creation - Permissions, file location and remove file

I have an Adwords script that creates a new spreadsheet by using the command below: var ssNew = SpreadsheetApp.create("Name document"); Is it possible to create this file in a specific folder of my ...
0
votes
1answer
18 views

new Date() function creating invalid date for specific months (Sept, Oct only)

I am working with date strings in Google App Script. I'm converting the strings to date objects, but having difficulty with specific dates. The below code creates 4 dates for Aug, Sept, Oct, and Nov ...
0
votes
1answer
18 views

Sending e-mail from Google Sheets at specified time on everyday

Its any possible to make script which sending us email with all of the one sheet at specified time on everyday? I have two sheets, which in first my employee is writing price and other data with date ...
0
votes
1answer
18 views

How to work with financial number formatted number in Google Apps Script?

I am reading numbers in financial #s format from cells. 5,000 is financialNumberOne and 3,000 is financialNumberTwo; var financialNumberOne = ss.getRange("A1").getDisplayValue(); var ...
1
vote
1answer
18 views

How to set multiple values on next row in Google Apps Script

Row after last row with the data in the spreadsheet var nextRow = SpreadsheetApp.getActiveSheet().getDataRange().getLastRow()+1; Five values var values = [[val1, val2, val3, val4, val5]]; I want to ...
0
votes
0answers
21 views

compare two colums in different spreadsheets in google script

i want to compare tow different columns in two different spreadsheets. My first spreadsheet is named "testtabelle" and the other is named "test" the name of the sheets are both "Tabellenblatt1" I want ...
0
votes
0answers
18 views

Get identity of last inserted row in Google Apps Script

Platform: Google Apps Script connecting to SQL Server using JDBC service. How do I get the identity (id) of an inserted row? (code provided below) I believe the solution is here: http://stackoverflow....
0
votes
0answers
5 views

What is the best way to parse XML data that might contain empty nodes?

I am using the parse XML service to parse some XML date. However sometimes there are child nodes that do not exist then I get an error if I try to getText() of undefined. So I started writing if ...
0
votes
1answer
23 views

Google's preferred method for interacting with Calendar: API or GAS?

To interact with my Google Calendar, I appear to have two options: The API - https://developers.google.com/google-apps/calendar/ or Google Apps Script - https://developers.google.com/apps-script/...
0
votes
1answer
17 views

Setting setFormulas() will clear the existing data

I want to keep the cell data as it is for those cells which have no formula applied. The code snippet explains the function. this solution too overwrites the values, setFormulas won't skip empty ...
0
votes
1answer
22 views

Running python script from Google Apps script

I have a python script (on my local machine) that queries Postgres database and updates a Google sheet via sheets API. I want the python script to run on opening the sheet. I am aware of Google Apps ...
0
votes
1answer
19 views

GAS: setFormula ) missing after argument list

I have the following line in GAS but it breaks when I use "", instead of 0 in the IFERROR part of the formula. cell.setFormula("=ARRAYFORMULA(IFERROR(VLOOKUP(K2:K,UPS!B:D,3,FALSE),""))"); It returns:...
0
votes
0answers
17 views

Google Sheets: Dynamic Query and Dynamic Column Widths

I'm trying to build a "dashboard" in Google Sheets that brings in multiple different data (from other spreadsheets) with dynamic =QUERY and =IMPORTRANGE statements controlled by a data validation ...
0
votes
0answers
28 views

Automatically delete temporary files in Google Drive submitted by Google Form

I have a Google Form that is used internally within our Organization. It allows people to submit files. The files are placed into a folder based off the name of the question in the form. The problem ...
0
votes
0answers
15 views

Admin SDK permissions have changed, script now generates privileges error

I have a project that runs every day to aggregate information from a central calendar, including the email address of each person who contributed an event, and then use the Admin SDK to retrieve the ...
-1
votes
0answers
27 views

GmailApp without Gmail

While looking into Google Apps script, I happened to try the very first "sample" script here: https://developers.google.com/apps-script/overview But running the script caused this error: We're ...
0
votes
1answer
15 views

How to upload a file via POST (doPost) to a Google Script's Web App?

My question is exactly as this one: Upload a file to a Google Web Apps with doPost How to upload a file directly to a Google Script's Web App from another domain? I answered a workaround in that ...
1
vote
0answers
28 views

Using google forms and GAS to dynamically create a chart based poll based on previous answers

So, what I want to achieve is creating a question based on previous answers, specifically such that the user would be able to rank their choices on previous questions. For example: What courses do ...
0
votes
2answers
21 views

Add youtube video to google document - is it possible? Through Apps script?

Is it possible to insert YouTube video into google document: 1. Manually (it must be video, not a link in text) 2. By Apps Script
0
votes
1answer
34 views

Google Docs Script: Move cell to two other sheets onEdit but no duplicates

I know Google Sheet formulas pretty well but not scripting. I borrowed someone elses code from stack overflow, tinkered, and failed misserably. Basically, what I am trying to do is when I type text ...
0
votes
1answer
11 views

Google Docs Apps script - how to remove really empty paragraphs

How we can remove really empty paragraphs from Google Document? This code will remove any paragraphs that contains images, hr's etc. Can't understand how to check if a paragraph really empty? getText()...
0
votes
1answer
22 views

what does row[12] mean when used as a condition

I have a delivered script that I'm having trouble understanding. if (!row[20] || (row[20] && rowHasChanged )) { I need to know... what does row[20] or !row[20] mean? I know that they ...
0
votes
1answer
24 views

Show/Hide span based on an item inside the span

I have the following in a form. It gets cloned and I want to be able to turn the display on of just one item. My cloning increments the number in the Name and ID of the input item. <span style="...
0
votes
0answers
20 views

Angular2 in Google Apps Script Web App

Is it possible to use Angular2 in Google Apps Script Web App? I searched enough, but there is no documentation/ article on the web which touches this topic. If it is possible, can anyone give me a ...
0
votes
0answers
15 views

Angular2 / Google Apps Script doPost()

Can anybody else experiencing / or can shed light on the following please. Calling GAS doGet() from Angular2 seems to work fine with the script running under the script owner. Doing the same with ...
0
votes
3answers
30 views

Google Apps Script custom function for sheets - range not found

I have an issue that's likely due to my lacking understanding on how the getRange() function works. I wrote two small functions to use in a Google Sheet, but I can't get cell references to work ...
0
votes
0answers
33 views

Google App Script - Importing txt, manipulating it, e-mailing exported txt

I'm quite new to writing scripts but I'd like to make my work life a little bit easier by automating the things I do on a daily basis. I need to write a code that allows me to take the following steps:...
1
vote
2answers
29 views

Automatic date if i change a cell

i know that's might a simple function, but i can't solve it. I want to write a simple onEdit function with the following conditions: If anything in a row (3 - xxx) is changed or updated, i want the ...
1
vote
0answers
21 views

can we do UNDO from Google app script for spreadsheet?

Actually I am trying to catch a changes using onChange event in Google spreadsheet using google app script. I am looking for do the UNDO which is exactly what we do in UI. The reason behind is I would ...
0
votes
1answer
30 views

Returning a number through a function

I've written a function that has a single parameter - updateBool. The function gets the existing value of the calling cell. If updatebool is yes, a random number is generated and returned as the new ...
1
vote
3answers
46 views

Copy data from one sheet, append date to rows and paste

I've done some reading but my limited knowledge on scripts is making things difficult. I want to: Copy a data range (C3:F20) from one sheet Paste that data in a new sheet In the new sheet, add today'...
0
votes
0answers
34 views

Run Google Apps Script in Android

I am trying to run an Apps Script script in Android. Here is my script: https://script.google.com/a/macros/hdsb.ca/s/AKfycbwSoiiutFyMT4Guo9M-It895ZqHzu5U-tP9BtnwfYx8/dev?phonenumber=...
0
votes
1answer
40 views

Pull Google Doc and inject it as a HTML Body

I have a form which submits into a google sheet and with some script it pulls the data, merges into a google doc, then converts it into a PDF. From there a PDF is attached to a email and a report is ...
0
votes
0answers
22 views

Getting occasional error getting user from Google PlusDomains

I have an app that make the following call successfully for 99% of the users: var profile = PlusDomains.People.get(userId); However, some users consistently have the following error: ...
0
votes
0answers
25 views

Sending a JSON request to launch a Google Apps Script

I am trying to create a new Google Doc using Apps Script. Here's the code of my macros: function createDoc() { var doc = DocumentApp.create('Sample Document'); var body = doc.getBody(); ...
0
votes
3answers
41 views

add/remove dynamic textboxes uniquely using javascript or appscript

I got this code from here which i have modified a bit to add unique numbers to the inputs. var i = 1; function addkid() { i++; var div = document.createElement('div'); var id = i; ...
0
votes
2answers
27 views

What is the purpose of Charts now that uiapp is deprecated?

Now that uiapp is deprecated, it seems that there aren't really many ways to use Charts. HTML service doesn't support Charts, rather you have to use the other google Charts API. Source I have a few ...
0
votes
0answers
13 views

AdWords Script - Populate Data Without Deleting Sheet Formatting

My current code works fine however it seems to be creating a new sheet each time, all formatting and formulas are gone once it executes. How can I prevent that from happening. I haven't had any luck ...
0
votes
0answers
19 views

Google Apps Script - Add date string next to edited cell [duplicate]

Hi I have what I assume is a fairly simple problem yet with my complete lack of experience with Google Apps Script I have struggled for a couple of hours now to find a working solution. Basically I ...
0
votes
1answer
18 views

Using IF condition to populate a new sheet in Google App Script Spreadsheet

I have a Google Spreadsheet containing 2 sheets. If the content of a specific cell in sheet 1 is equal to something, I want to write something in a specific cell of the sheet 2. As I need to do it a ...
0
votes
1answer
20 views

Largest practical datasets in Google spreadsheets?

I'm looking into using google sheets as some sort of aggregation solution for different data sources. It's reasonably easy to configure those data sources to output to a common google sheets and it's ...
-1
votes
0answers
25 views

I can't access MYSQL data in google spreadsheet. How to solve it?

When I access mysql data (which is my pc) to google spreadsheet I get some error.The error is Failed to establish a database connection. Check connection string, username and password. (line 8, file "...
0
votes
1answer
20 views

Google Script App: Why can't I send ajax requests to my web app?

I'm sorry if this question is duplicated but I've couldn't find a solution for this. I need your help with Google Script Web App, please. I built a very simple Web App for tests using Google Script ...
1
vote
1answer
19 views

User access affecting onEdit function in google sheets

I had a question about the following script: It works for me, but it doesn't seem to trigger for shared users. I've read that simple triggers will work for anyone, but installed ones won't. I'm ...
0
votes
0answers
21 views

Angularjs + Google App Script - ng-view

This question is related to another one: Using ng-route with Google-Apps-Script or some means of rendering a partial html view that I even gave an answer. I was trying to do it using <?!= ...
0
votes
1answer
14 views

Find the folder ID of the current Google Apps spreadsheet

In a script bound to a Google Sheet, how can I learn the ID (not the name) of the folder containing the current sheet? I want to do this: var files = DriveApp.getFolderById('...
0
votes
1answer
23 views

How to make onEdit() script work on all rows modified when a list of values pasted from the clipboard?

I have a sheet where I want to track for each new row, the date when the value of a certain cell was first filled and also the date when any cell in that row is updated. So I have this script that ...