FAQ Database Discussion Community


Code gives out “strange output”

google-apps-script,google-spreadsheet
I am haveing some trubble witht this code. My output will look somthing like this. "29 days, 29 days, 0 hours, 29 minutes". The only variable outside of the code is toon.lastModified. it can be somthing like 1431769709000 . The task for the code is to tell how mutch time...

Execution Success, but no Results?

java,javascript,google-apps-script,scripting,google-apps
So, i'm working on creating this approval workflow for google forms. I'm new to this, I've searched online and read through some tutorials as well as google's but most of the stuff that I have seen has been deprecated. I think i have my triggers current, they're set to onformsubmit...

Constantly getting an email: Cannot read property “0” from undefined

javascript,google-apps-script,gmail
I am constantly getting emails from "me" with this in it: Cannot read property "0" from undefined. I think it has something to do with Google Apps script because it started when I tried to code something. (for details: I was trying to code a "Contact Us Form" for my...

Link in Email to a Google URL not working

html,user-interface,google-apps-script,google-apps,google-form
I'm trying to create a simple workflow using Google Forms which sends an automated e-mail for approval. function sendEmail(e){ var requestorEmail = e.values[1]; Logger.log('replyEmail: ' + requestorEmail); var SupervisorsEmail = e.values[2]; //manager e-mail var ApplicationID = e.values[3]; var ApplicationDate = e.values[4]; //dateconfirmationSent var ApplicantName = e.values[5]; //interpreter name var MBO...

Form “required” attribute in form input field not causing anything to happen

html5,google-apps-script,html-form,required
I'm Andrew from Italy, I'm trying to adapt a script I've found on line. It's a script that creates an HTML form and uploads answers in a spreadsheet. This is the tutorial from wich I've started: GS CODE: var dropBoxId = "XXXXXXXXXXXXXXXX"; // Drive ID of 'dropbox' folder var logSheetId...

Google Calendar: How to check guest is not busy and available to book through google calendar

google-apps-script,google-api,google-calendar
I am exploring to write google calendar api integration through google scripts or apis. Is there a way I can check a guest is available before I book an event ?...

Google Spreadsheet setBackgroundColors() “Deprecated”

google-apps-script,google-spreadsheet
A gs I have been using in the past to check for duplicates, is no longer working. The script would check all cells in the spread sheet if any were identical it would highlight all their occurrences green. I also had another function that would revert all the cells back...

Delete or Trash specific file in Drive

google-apps-script
I had a script that ran every day at 5 am, that would move a specific file (data.xls) to the trash. However, since DocsList has been retired, the script no longer functions, and I'm having trouble updating it. I've seen a couple of delete/setTrashed scripts posted here, but they all...

Why is .setUTCFullYear() and .setUTCMonth() return different results

javascript,google-apps-script
In this sample code to convert a string to a date: function stringToDate(){ var edate = "2015-06-01"; Logger.log(edate); var input = edate.split('-'); var date = new Date(); date.setUTCFullYear(input[0],input[1] - 1,input[2]); Logger.log(date); } Logging the date returns "Mon Jun 01 20:07:45 GMT+01:00 2015", which is correct, as the month '06' -...

How to get the last entry containing a certain value in Google Spreadsheet

google-apps-script,google-spreadsheet,google-form,formulas
I have an answer spreadsheet linked to a Google form. I wish to get the last date that and answer was submitted. Lets say I my entries look like this : DATA : A B 1 Date String 2 2015-05-09 Abb 3 2015-05-11 Bcc 4 2015-05-12 Cdd 5 2015-05-20 Bcc...

How do I select a range of cells in without giving the range a name?

google-apps-script,google-spreadsheet
I would like to select cells C29:Z50 as a variable using apps script. I'd prefer not to have to create a named range (but I can if needed). My goal is to create some custom formatting beyond colors that can use built in functionality. So, if cell B27 = "Transactions"...

Script for Gmail label to Sheets

google-apps-script,gmail
I am trying to make a script that takes an email within a certain label and puts it into google sheets. Im using this function at the moment: function getMessagesWithLabel() { var destArray = new Array(); var threads = GmailApp.getUserLabelByName('Facebook').getThreads(0,10); for(var n in threads){ var msg = threads[n].getMessages(); var destArrayRow...

Google Sheets API for clickable images in Google Sheets

google-apps-script,google-spreadsheet,google-spreadsheet-api,google-spreadsheet-addons
In Google sheets, you can insert a clickable image to a cell which links to a function in app script. Can we also insert this clickable image and link it to app script from our server using Google Spreadsheet API? Or Can we call app script from our server? https://developers.google.com/apps-script/guides/menus#clickable_images_and_drawings_in_google_sheets...

How to create an error function that can terminate in Google app script

javascript,google-apps-script
In Google Sheets, I'm trying to create a checking function with Google Apps Script to ensure that certain cells are correctly filled up, and only if they're correctly filled up will the rest of the script run to update a separate table. In the code I've written, the updater function...

Advanced Drive Services in Addons

google-apps-script,google-drive-sdk
I have a Google Script that uses the Advanced Drive API service and am now looking to convert this script into an Add-on. However the Drive API needs to be enabled manually by the user before using the service inside the Apps Script. Is it possible to use the advanced...

Calling FormApp within doGet(e) function

google-apps-script,google-form
I am relatively new to scripting, so please be kind. I am trying to create a function bound to a Form within Google Apps, including a webapp which captures 3 variables (requestNum, approverNum, and status) and obtains various other information from the FormApp (e.g titles, responses, etc). I am receiving...

How to pass the “e” parameters to a function called with a trigger?

google-apps-script,google-spreadsheet
I am working on a simple spreadsheet, and need to do some operations when my form from Google Form is submitted, and the values are inserted in the spreadsheet. Reading the docs I've found that I need triggers, it all seems straightforward, but I am missing something: function setIncomes(e){ var...

Prevent HTML Page Refresh

google-apps-script
At this stage I'm mostly used to backend Javascript and server side Java, so my HTML is not as savvy as it needs to be. I've built several applications that require user input with Apps script, but I was using the now deprecated UI service, as I'm not a designer...

Unable to select some text from Google Docs with a simple regex

regex,google-apps-script,google-docs
I'm trying to highlight some text (in the example below I would like to highlight "ORGANIZA") with some regex on a Google Docs document, but I'm unable to make first work a simple regex to find the "category_name" string. Why this: function highlightTextTwo() { /* DOCUMENT DEFINITION */ var doc...

How to real-time monitor the emails?

api,google-apps-script,gmail,quota
Good day! I want to offer the implementation of google apps to my company. Also we have a need to reply on messages, that we recieve through our web-site in 10 minutes time limit. For this purpose our big team of sales managers a handling emails when they have a...

How to remove quote mark from array

javascript,google-apps-script
I have a script that will import data from a csv file in to a Google sheet. I would like to include the following to remove the quote marks from the data - .replace(/"/g, "") - but am not sure of the best place/syntax to add in to the existing...

How can I exclude a sheet in an array, and sort with a range

google-apps-script,google-spreadsheet
Good Morning everyone I have a code that was posted here a while back, I recently started using for a google spreadsheet and tweaked it a bit, how ever there are 2 thigs I have not been able to accomplish the first thing is to Exclude the Master sheet from...

Search for value in variable Google Apps Script/JS

javascript,google-apps-script,google-calendar
Trying to determine if calendar events in Google Calendar were created by the user himself or if a CSV bulk upload was performed. If the script finds an ID with "CSV" somewhere in the value, then remove it. I tried to add an if statement where it looks at the...

Apps Script - Web App: Visible Source Code / Library?

web-applications,google-apps-script,source-code
If I publish a project as public web app, to receive and response only a few variables... is then the complete source code and maybe the used library visible to all users?

Modify existing form Values - GetChoices() not working

google-apps-script,google-form
Why does '.getChoices()' not work for existing list items? I have the following code which gets an item in a form by it's ID, and I intend to update the values of the form item. However, when using the .getChoices() method, it fails with the error 'TypeError: Cannot find function...

Apps Script GmailApp archiving not working

google-apps-script,gmail,gmail-api
I have a function which I wish to tie to a daily time trigger in Google Apps Script. The function is supposed to take all e-mails in my Inbox marked as read that are older than 14 days and archive them. Here is the code, which I got from here...

What is this Google Spreadsheets IMPORTRANGE() Sheet key?

google-apps-script,google-spreadsheet
I'm new to Google sheets, and I've got this spreadsheet with some IMPORTRANGE functions in them, and they look like this: =IMPORTRANGE($O$2; "Jan!B33") That first value, $0$2, is supposedly the spreadsheet key, but I'm used to that spreadsheet key coming from the HTML, for example "1QCfFIx6evcghuH4k74_ksqx6P7sb5xzUpRaoQobV6MA", or something like that....

GAS external user autentication

google-apps-script,google-sites
We are a italian municipality, we have to start a google site to let the people to signal city issues. Unauthenticated users can post or view issues, Google domain's authenticated users, can edit some information. For some categories, external companies are engaged for solution, these aren't google domain's users, but...

Google Apps Script - Sharing outside of domain

google-apps-script,google-form
So I have followed the tutorial here, and everything works great... for me. google forms file upload complete example What I need to do is add the script to a Google Form, and allow users to upload an image along with the form. I know it will only put it...

Stylesheet for .html document not imported

google-apps-script
I have this form I created in HTML (called form.html) written in google apps script and I also have a stylesheet (CSS) to go with that. All is working well when I have the CSS in the same HTML-file as the form. However if I want to put my stylesheet...

Google Apps Script (Javascript) - findText returns location relative to inline image, not start of paragraph

javascript,google-apps-script,insertion,inline-images
I am trying to insert an image in the middle of a paragraph from the results of findText, but when there are other images before in the paragraph it doesn't work as planned. Currently, my code(partially based on the responses to this question) works by finding the place that needs...

“undefined” when trying to get values from spreadsheet with Google Apps Scripts

javascript,google-apps-script,google-spreadsheet-api,google-form
I'm getting an "undefined" error when I try to get the value from a cell in a spreadsheet. The thing is that if I execute the same command for a different cell I get the value in that cell. The only difference between those 2 cells is the way the...

Edit a Google Spreadsheet using Google Apps Script

google-apps-script,google-spreadsheet
I am trying to edit a google spreadsheet using google apps script. Basically, I have a cell in the spreadsheet that has the value "Pending Approval" in it. When the script is executed, I want it to change the value in that cell to "Approved". Is there a simple way...

Script to check for email subject not in inbox runs without error but not as expected. Not sure what is wrong with syntax.

google-apps-script
I get an automated email when an event occurs, but need to be notified if it isn't received. It's easy to overlook something that doesn't happen. Here's what I have, but the var c remains 0 when script ends (I'm expecting it to not be 0 if email is found,...

Google Form to Document Merge to Pdf to Mail

google-apps-script,google-spreadsheet
I think my issue is in the e.values I am using along with the ('keyXXXXX', XXXXX); that I am using. The original code I used was something I borrowed from TJ Houston's site. I am using it for an application process. I wrote the code following the process of using...

Any way te read an excel file from a Google Sheet?

excel,google-apps-script,google-drive-sdk,google-spreadsheet,google-apps
in my organization we work with Google Apps but we have one file that we need to maintain in Excel due to its complexity. All my other spreadsheets are Google Sheets and a lot of them need to get data from that excel file. So my question is: is there...

On Change Trigger Not Running Script On Change

google-apps-script,google-spreadsheet
I have a script to update named ranges when new rows of data are added to the spreadsheet in question: function updateNamedRanges() { // get to the right place var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName('ga weekly data pull'); //now update the named ranges if they have changed in...

Google Scripts + Google API PHP

php,google-apps-script,google-api,google-apps,google-api-php-client
I am trying to call one of my Google Scripts from my google-api-php-client and I can't find how to do this. I deployed my app as a web app, and I got the web app url which I can call with curl, but I need to call it as my...

Google Script get active row inside Array

google-apps-script
I have this google script to read rows from a google spreadsheet but I need to find out the row number of the active array element. The goal is to check if a row has been processed or not (statusverwerkt variable). If the value of 'statusverwerkt' is 'x' I create...

Google Apps Script return array values and use them in a javascript function

javascript,arrays,google-apps-script
I am trying return an array and use it in a javascript function, but it doesn't seem to work. My Code.gs is as follows: function doGet() { return HtmlService.createHtmlOutputFromFile('test') .setSandboxMode(HtmlService.SandboxMode.IFRAME); } function test() { var locations = []; var ss = SpreadsheetApp.openByUrl('https://docs.google.com/spreadsheets/d/13q7pIeMUHll6_5xBUpBavaBqALt9fnFnOIO-Hwy_pFc/edit'), sheet = ss.getActiveSheet(), range = ss.getRange("D2:D4"), values =...

Access dropdown items in Google App Scripts UiApp

google-apps-script,listbox
I'm using the older depreciated UiApp class in javascript (because I have to) where I have a dropdown list I need to access the ListBox, and see all the values that it contains. Is there a way to do this? All the items must be present because there is method...

SpreadsheetApp.getActiveSpreadsheet() is breaking script

google-apps-script,google-spreadsheet
I'm writing my 1st google app script. Spreadsheet opens a sidebar in onOpen(). Sidebar has Button and in SidebarJavaScript.html I have listener to that button. I'm calling SpreadsheetApp.getActiveSpreadsheet() inside listener and after this line script is not executing. What could possibly be wrong here? function onScrapeClick(){ // Disable Button this.disabled...

Youtube.Playlist.list ReferenceError

google-apps-script,youtube-analytics-api,youtube-data-api-v3
When I'm using Youtube.Playlists.list in Google App script, I'm having an error that says "ReferenceError: "Youtube" is not defined". I enabled Youtube Analytics API and Youtube Data API but the error still appears. May I know how can I make this work? function myFunction() { var playlistResponse = Youtube.Playlists.list('snippet',{ mine:...

Get column to display month name Google App Script

google-apps-script
How do I set a column to display the name of the month instead of the whole date using the script? The function can manually be performed by selecting Format>Number>August in the menu but I want to do this in code. This is what I've tried but I can't seem...

getJSON from Google Apps Script not working in Safari

google-apps-script,safari,getjson
I've created this piece of code to handle my user login. var gasUrl = "https://script.google.com/macros/s/[my id]/exec"; function submitFormData() { var username = $("#inputEmail").val(); var password = $("#inputPassword").val(); $.getJSON(gasUrl + "?username=" + username + "&password=" + password, function(data) { if(data[0]) { localStorage.setItem("username", data[0].username); localStorage.setItem("id", data[0].id); window.location.href = "/index.php"; } else {...

Fetch HTML Service Values by ID

google-apps-script
In the sample code: HTML (Index): <form> <br><br> Name: <br> <input type="text" name="name"> <br><br> Comments: <br> <input type="text" id="comments"> <br><br> <input type="button" id="button" value="Submit Info" onclick="google.script.run .testFunction(this.form)"> </form> Code: function doGet() {//Creates the webpage return HtmlService.createTemplateFromFile('Index')//From the GUI file. .evaluate() .setSandboxMode(HtmlService.SandboxMode.IFRAME); } function...

How to find text in a string using google script?

javascript,google-apps-script,google-spreadsheet
I tried indexOf(), findText() and other few methods for finding a string pattern in a text in google app script. None of the above method works. var str="task is completed"; I'm getting this string from google spreadsheet. I just want to find whether the above string contains a string "task"...

HTML Loading Messages

google-apps-script
Is there a way to pass a value back to a HTML page while a server side function is running? In the past when I was using the UI service, early in the function I would just create a label in the UI like: app.createLabel('Working, hang on!'); and it would...

Google Drive App - Method makeCopy (string, string) not found

google-apps-script
Using Google Apps Script I get an error "Method makeCopy(string,string) not found" when the below function is invoked. However I cannot see my mistake. The auto-completition feature of the Google Apps Script even offers the method. function createDuplicateDocument(sourceId, name) { var source = DriveApp.getFileById(sourceId); var newFile = source.makeCopy(name, TARGET_FOLDER); return...

Google Apps Script Time Based Trigger Date and Hour

google-apps-script,triggers,clock
I can add a time-driven trigger to run on a specific date and time manually via the resources menu, but I cannot find how to do it programatically. I have the .at(date) method, but to this I would like to add a specific time. Is that possible programatically? Example from...

A script to copy one sheet to various spreadsheets in a specific folder in Google Drive

google-apps-script,spreadsheet
I have a sheet which I need to copy to hundreds of spreadsheets in a given folder in Google Drive. I am just beginning with script and I do not know how to proceed because the script below just gives me an error. Thanks. function myFunction() { var source =...

Search Google Spreadsheet for same value and append in next column in GAS

google-apps-script,append,spreadsheet,value
I've got a Google Spreadsheet which looks like this: ID | winkelName | 26/05/2015 | 1 | Foo | | 2 | Bar | | 3 | Foo2 | | 4 | Bar2 | | I'm trying to read and write an array of objects with the following structure: history[i].storeName...

Parsing Special characters in google apps script

google-apps-script,text-formatting
I am trying to pars a xml file into new google users, This xml file contains the usernames made from the front and last name of the specified user. However when creating users it generates an error becaus some names have ilegal caracters in them. These ilegal caracts are stuff...

Javascript (Google Scripts) value from a function is not returning

javascript,google-apps-script,google-spreadsheet,google-calendar
I think could be a simple one to solve, I am stuck working this simple issue out. I have called a createEvent function to create a google calendar event. As part of this function I also get the google calendar event ID as EventId and want to return it. For...

Google Apps Script: Bi-directional sync when rows are deleted

google-apps-script,google-spreadsheet
I have two sheets which are synced in Google Sheets using a GAS i found on this SO, which i put on a change trigger Google Apps Script: Is there a way to keep two sheets synchronized? script is here var sourceSpreadsheetID = "ID HERE"; var sourceWorksheetName = "SHEET NAME...

DriveApp.getFolderById Permissions

google-apps-script
I'm trying to "upgrade" an old script from DocsList to DriveApp and having a problem with a getFolderById call. The script had worked previously using DocsList.getFolder. I have a (previously-created) folder named "Email Archive" that I'm trying to access in script. Through using Logs and Execution Transcript, I've verified that...

Loading calendar via Scriplets

google-apps-script
I'm trying to use scriplets to load an embedded Google Calendar in an Apps script page, and I'm having mixed luck. This is my HTML code with an 'iFrame' section. The scriplets in this code simply grab the users email, formats it by replacing the '@' symbol with a '%'...

Output API data to a csv file

google-apps-script
I have Frankenstined bits of code together found on here and on various Google tutorials. My goal is to get data from the Google Analytics API and output it to a file in my Google Drive "my_data.csv". I am able to get my data from the GA API in a...

Google script doGet TypeError: Impossible to call method “getSheetByName” of null

javascript,google-apps-script
I have a spreadsheet bound google apps script and I would like to use the doGet function to control the spreadsheet/mail sending from the outside. Basically a user gets a mail onFormSubmit with two links (I'm trying with the dev version of my code): https://script.google.com/a/macros/..mydomain.../s/...myID.../dev?line=6&answer=ok https://script.google.com/a/macros/..mydomain.../s/...myID.../dev?line=6&answer=no The function is the...

Function to check for first blank cell

javascript,loops,google-apps-script,google-spreadsheet
so, I'm attempting to define a custom function that returns the row number of the first blank cell it finds within a custom range. function checkForBlank(startRow,startCol) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheets()[0]; var checkRow = startRow; var checkCol = startCol; var range = sheet.getRange(checkRow, checkCol); var i...

In what format the query parameter in google app script stored?

javascript,google-apps-script
I was trying just if/else in google app script. The following code should give "arun" as output, but its showing "prakash" . What's wrong with my code? URL : https://script.google.com/macros/s/AKfycbzNYCFOofexc4AuA58M0yK6amiA0xcuAYuEJBbsRNgT7f7bD3AE/exec?queryString=arun function doGet(request){ if(request.queryString=="arun"){ return HtmlService.createHtmlOutput("arun"); }else{ return HtmlService.createHtmlOutput("prakash"); } } ...

How to communicate between HtmlService Javascript and Server Google Apps Script

google-apps-script
I'd like to create my first Google Docs Script to generate an amount but it seems not working well like this : function onOpen(e) { DocumentApp.getUi().createAddonMenu() .addItem('Start', 'showSidebar') .addToUi(); } function onInstall(e) { onOpen(e); } function showSidebar() { var ui = HtmlService.createHtmlOutputFromFile('Sidebar').setTitle('Calcul tarification Icecom'); DocumentApp.getUi().showSidebar(ui); } function calculPrice(compagnyType, hours) {...

Merging Multiple Arrays Evenly/Alternating with Javascript and Google AppScript

javascript,arrays,google-apps-script,merge
I'm trying to merge multiple arrays evenly/alternating in javascript/Google appScript. There are several arrays (5 or 6). I've tried 2 different methods, but neither worked. I don't work a lot with javascript honestly and I've managed to get the code to this point, but I can't get it merge properly;...

Google Sheets Script - changing the contents of a cell based on a given condition

google-apps-script,google-spreadsheet
I'm attempting to set up a submit button that changes the contents of a cell based on the selection the user makes on another sheet. [ Something along the lines of getrange(match()).setvalue() ] I can't seem to find a way to identify the correct range with the script. Attached is...

Google Spreadsheet (Using named range in script)

google-apps-script,google-spreadsheet
Trying to get my script to use a named range. In that range I am trying to reset the cell colors back to white. I keep getting an object error, can't figure out how to make this work. function resetCheckDirectory() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var tableRange = ss.getRangeByName("rangename"); tableRange.setBackgrounds("#FFF");...

Google Sheets - propagate column date formatting to new rows

google-apps-script,formatting,google-spreadsheet,rows,propagation
The date format in the column is not propagating to new rows, whenever new rows are being added to the bottom of the sheet. The column formatting is not automatically applied - this in regards to date, currency format, alignment etc.

Adjust file created date value for date between evaluation using Google Apps Script

javascript,google-apps-script
I want to look at the file created date instead of the current date and add 6 days so my between code will work properly. var dateFrom = file.getDateCreated(); var dateTo = new Date(); dateTo.setDate(dateTo.getDate() + 6).toString(); var dateCheck = new Date(); dateCheck.setDate(dateCheck.getDate()).toString(); var from = Date.parse(dateFrom); var to =...

How to call aspx page from google app script? [closed]

javascript,google-apps-script
I am new to google app script, and i need to call aspx page, i tried lots of things. like using javaScript, Jquery,Ajax but none of this work. can anybody help me in this.Here is my google script code. I am getting this error "We're sorry, a server error occurred....

Publish a Spreadsheet Add-on in the Chrome Store

google-apps-script,google-apps,google-apps-marketplace
I'm trying to publish a Spreadsheet Add-on following the the app scripts documentation but I get this error: Please fix the following errors: API Console project with the id specified in the manifest's api_console_project_id field, does not have Google Apps Marketplace SDK enabled. api_console_project_id Here you can see a screenshot:...

Output Google Spreadsheet to XML/RSS/Atom using Google AppScript Content Service

xml,google-apps-script,rss,google-spreadsheet,google-docs
So I've searched this site and found nothing really useful so far to accomplish this. I am wanting to turn a spreadsheet into an RSS feed using google script content service. How do I declare column values (i.e. pubDate, Author, Content) so it will output correct RSS/Atom feed. Following their...

Google Sheets moving rows between separate spreadsheets not working but between sheets is working

javascript,google-apps-script,google-spreadsheet
I have a short function that I made using the answers to other questions here but it is not working perfectly and I don't understand why! function onEdit(e) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var s = e.source.getActiveSheet(); var r = e.source.getActiveRange(); if(s.getName() == "Input Expenses" && r.getColumn() == 14 &&...

printing spreadsheet to pdf then saving file in drive using oauth2

pdf,google-apps-script
function topdf() { var foldersave=DriveApp.getFolderById('0Byy1DdsfdfTQRnVlfb05wOV83T00') var d= new Date() var oauthConfig = UrlFetchApp.addOAuthService("google"); var scope = "https://docs.google.com/feeds/"; //make OAuth connection oauthConfig.setAccessTokenUrl("https://www.google.com/accounts/OAuthGetAccessToken"); oauthConfig.setRequestTokenUrl("https://www.google.com/accounts/OAuthGetRequestToken?scope="+scope); oauthConfig.setAuthorizationUrl("https://www.google.com/accounts/OAuthAuthorizeToken");...

Can I add a Trigger based on change of a particular cell?

google-apps-script,google-spreadsheet
I have a script that is currently set to run onEdit. Ideally, I'd like the script to run ONLY when someone makes a change to cell B26 of the sheet in question. Is this possible?...

How can I make an RSS feed from Youtube search using Google App Script?

google-apps-script,rss,youtube-api,youtube-data-api,youtube-v3-api
Since Youtube shut down its RSS feeds for searches with it's newest version of the API, I've been trying to recreate them using Google App Script. Here's what I have so far (based off of this tutorial for converting a twitter widget to RSS): function getSearches(a){ try{ var rss,title,link; title="Youtube...

Google Spreadsheet - is there any way to export conditional fomatting script

google-apps-script,google-spreadsheet
I created a lot of conditional formatting on one of my sheets. I would like to export it as an app script so that I can use it on any other sheets (of the same type) in the future. I know how to create conditional formatting using scripts but could...

How to connect PHP GAE(Google App Engine) to Google Docs, Spreadsheets

php,google-app-engine,google-apps-script,google-spreadsheet,google-docs
I have a PHP app deployed in GAE(Google App Engine) I need to connect to Google Docs, Google Spreadsheet URL below and do all editions/manage(edit a Doc, Edit a Sheet,...etc) as like I am able to do via GAS, just like we manage the CAL API. https://developers.google.com/apps-script/reference/document/ https://developers.google.com/apps-script/reference/spreadsheet/ What...

google-apps-script count files in folder

if-statement,google-apps-script,count,google-drive-sdk
I've had a search but cannot seem to find what I am looking for. I am seeking the code to enable me to do this pseudocode: Count number of files in specific Google Drive folder (by folder Id) If file count is above 'x' do this {other piece of code}...

Apps Script - How Do I Remove A Paragraph Of Text?

google-apps-script,google-docs
I built an app script to copy a doc and edit it based upon the data I have entered into a google spreadsheet. Once the doc is copied and edited, I would like to remove certain text paragraphs. I was using the following to see if I could find the...

How to get a button from a Google Apps dialog

javascript,html,ajax,google-apps-script
I must be missing something really stupid here, but I just cannot work to get an interface button from a dialog box in Google Apps. If I try to set the disabled to false in a this object from the "click" function, the button is enabled. But if I try...

Can't SELECT DISTINCT via Google Fusion Tables REST API

sql,google-apps-script,google-fusion-tables
In my Fusion Table, my State Abbr. column contains many duplicate values; and I only want to list the different values. So I tried querying the table with SELECT DISTINCT 'State Abbr. FROM <table_id>' But I got the error below; so, I guess that it doesn't like SELECT DISTINCT Invalid...

Pass webapp link parameter to html file in Google Apps Script

google-apps-script
I am trying to pass a parameter from a webapp link, so it can be used to pre-fill an html form (using HtmlService). Apps Script - function doGet(e) { var formId = e.parameter.formId; return HtmlService.createTemplateFromFile('Index') .id = formId .evaluate() .setSandboxMode(HtmlService.SandboxMode.IFRAME) } Index.html - <form id="myForm"> <input type="text" name="formId" value="<?=id?>"><br> <input...

How to implement rangeProtect() over multiple tabs - google spreadsheet

function,google-apps-script,google-spreadsheet,spreadsheet
I'd like to implement a script to implement range protections on the different tabs of the spreadsheet when someone create a new spreadsheet by copying my template. The issue I encounter is when the script run through the protection implementation. My code seems to be fine as per the debug...

Google Docs Mail Merge script not working as of last week

javascript,google-apps-script,google-spreadsheet,google-docs
A mail merge script that we use for 5 of our google docs stopped working last week - a similar thing happened a few weeks ago when DocsList became obsolete and I was able to fix it, but now it has stopped working again. var docTemplate = "15kvC3M8b0Me3Vi3GwErQvG60BlTC0qAHMXrlc3Ocky8"; var docName...

Google spreadsheet script authorisation to BigQuery

google-apps-script,google-spreadsheet,google-bigquery
I have a Google spreadsheet with a script that connects to BigQuery (using this tutorial - https://developers.google.com/apps-script/advanced/bigquery?hl=ar-AE). It adds an extra menu option and users can run the script that executes a query to BigQuery. It works fine for me and I want to share this spreadsheet with other users...

Break Google Apps HTMLService Page into multiple .html files

google-apps-script,google-apps
I want to combine a few related HTMLService interface in to a tabbed page. I can get the tabs working using the code here. But I want to put the page for each Tab into a different html file in the project. How would I show Billets.html inside the div...

How to prevent Google Forms from converting form input to scientific notation format

javascript,google-apps-script,google-docs,google-form
I have a simple script set up that sends emails based on Google form entries using a script-based VLookup to get the contact emails. In some cases, Google Forms converts longer numbers entered into the form field to scientific notation. A workaround I have been using is to enter an...

Can I add a specific sentence to a cell based off of another cells answer?

google-apps-script,google-spreadsheet
I have a script that will move rows based off of an answer. Can I add update a cell with a static sentence based off of another cells answer? For example, if X1 in Spreadsheet1 is"Yes", then it adds the sentence "Your job was successful." to cell F1 in Spreadsheet2?...

Pass Comments & Suggested Edits from a Google Document to a Google Sheet

google-apps-script,google-drive-sdk
Fellow Stackers. I'm using a Google Apps Script to (a) capture all "Comments" in a Google Document... ...and (b) list them in a column of a Google Sheet... However, I'm wondering if it's possible to... (1) Array "Comments" into individual cells down a column in my Sheet rather than into...

Nslookup or dig in Google App Script

google-apps-script,google-spreadsheet,nslookup,dig
Is there any way to run an nslookup / dig in Google App Script? I m looking to get the results of this command in a Google Spreadsheet. Thanks...

How do I make a Sidebar display values from cells?

google-apps-script,google-spreadsheet
I have a Google Sheet that I'm using as a database of clients. There are quite a lot of variables (columns) that I need to store per entry, so I thought that it would be easier to view each entry if I could have a Sidebar display all of the...

Google Spreadsheet Addon - unsubmit pending version

google-apps-script
I have a Google Spreadsheet addon that has been running for a while now. A few days ago, due to to a change that happened on my company's server side, I submitted a new version to be published. Usually, this takes about 30 minutes. However, this time I got a...

Running Apps Script from Chrome extension requires authorization

google-chrome-extension,google-apps-script
I'm trying to execute a Google Apps Script from an event on my Chrome extension. While it works great, when ran for the first time by a new user, the apps script requires for the user to give it authorization before it can execute. The problem is when running the...

Google Drive - How to List all Files in a specified folder

php,google-apps-script,google-api,google-drive-sdk,xampp
Hi I am stuck here with this situation, I have tried a number of different approaches but I cannot get what I am after. Situation: I have a large number of files in folders hosted on google drive. For instance a single client folder for reports has between 2000-10000 files(this...

Google sheet app script errors after laptop sleep

google-apps-script,google-spreadsheet
I have a custom function in a sheet that calls a mysql database. It extracts one value from mysql per row, e.g. | A | B -------------------------------- 1 | YES | =readCompleteFromMember(A1) 2 | NO | =readCompleteFromMember(A2) If I let my laptop go to sleep and open it the next...

Using the UrlShortener API in a custom Spreadsheet function

google-apps-script,google-spreadsheet,google-docs,add-on,url-shortener
I would like to use an API (url shortener) with a public google Add-on. For the moment my code returns: Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup. Is this possible? If yes, Do I need an authentification Token? If yes, what key type should I choose? How...

How can I get keyboard events in Google Spreadsheets?

google-apps-script,google-spreadsheet,spreadsheet
How can I get keyboard events in Google Spreadsheets? I want to use this events in my script to format non-adjacent cells.

Google Spreadsheet custom function to add csv in spreadsheet

google-apps-script,google-spreadsheet,google-spreadsheet-api
I am using Google spreadsheets, and in my google spreadsheet i want to import data from my RESTful web service. I cant use =IMPORTDATA due to the fact that i need to add a header to the url for auth purposes. This is the custom function i have so far:...

Call Google Spreadsheet script function from external app

google-apps-script,google-spreadsheet
I have Google spreadsheet with script attached to it (with the Tools->Script Editor tool). I want to call one of script function from external Android App. Is it possible? Should I use Spreadsheet API?...

Google Apps Script: event.setTime error and time format

google-apps-script,google-spreadsheet,google-calendar
I'm creating something of a booking system which is nearly complete. Currently I'm collecting data from a form, passing it to a sheet, and then using some of that info to create a calendar event. This all works fine. On creating the event, I'm also collecting the eventID so that...

Google Sheets Adds-on open automatically when user opens a sheet or clicks a link in worksheet

google-apps-script,google-spreadsheet
I created an google sheets add-on. However, it is a bit hidden in the adds-on menu. Is there a way to enable the Adds-on automatically when user opens a sheet or when user clicks a link in a sheet? I searched on Google Sheets documentation but found nothing. EDIT1: Since...