New answers tagged

0

From the question: EDIT: I think it has to do with the last line //copy data array to destination sheet being set to always true. Can't figure out how to make it conditional. Put that code line inside an if statement. Example: if(data.length > 0){ //Copy data array to destination sheet csh.getRange(csh.getLastRow()+1,1,data.length,data[0].length)....


-1

Editor's note: This answer is explaining how to use the script shared in another answer For other non-expert people like me, in Google Sheets: Go to tools>script editor Clear everything, then paste the script At the "THIS_SHOULD_BE_YOUR_FOLDER_ID" you have to insert your Folder ID (Just the ID, but leave the "". You can find the ID if you open your folder ...


0

You can use the same QUERY formula (with minimum alterations) to get your results for all 3 tabs. The formula to be placed in A1 of your Month 3 tab would be: =query(Subscriptions!A1:K, " select * where D matches '(1|2|3).+' ",1) Making a minor change in the query -change '(1|2|3).+' to '(1|2).+' or '(1).+'- you can use use the same formula for tabs ...


0

To do A and B there are two paths Add the script code to a Google Apps Script project owned by you (the same account used to run the script should be its owner) Create an add-on a ask Google to verify your script. References https://developers.google.com/apps-script/guides/services/authorization


-1

This has now been solved. To see how the solution was built, or to get a copy of the Script click here.


0

As of Feb 2019, you can now do this with the Google Docs REST API in addition to Google Apps Script as mentioned in the other answers. Here's a blog post I wrote linking to the video, page in the docs, and a working (Python) sample app I created that does exactly what the OP requested, mail-merging data from Google Sheets into a form letter created via ...


0

One problem with you formula is that the url is enclosed between < and >, remove these characters. Regarding your function, the arguments in masterCal.createAllDayEvent(title, location, description,date) have not being declared. You could save a lot of time while writing your scripts / fixing them by following the recommendations of https://...


0

To solve the error change spreadsheet.getRange(dest).activate(); to dest.activate();


0

Short answer: Yes, it's possible to copy a range from one spreadsheet to another It's very likely that your googling didn't give you the results that you are looking for because you are not using the terms commonly used: spreadsheet and workbook, actually, the Google Apps Script use spreadsheet for the file and sheet for the sheets that it contains. You ...


0

Select your data and create a pivot table


1

To create a custom function use Google Apps Script. This is very similar to writing a JavaScript function. /** * If the arguments are numbers, the sum of will be returned * If one of arguments are strings, they will be concatenated * * @customfunction */ function myCustomFunction(a,b){ return a + b; } Start by reading https://developers.google....


0

Your function doesn't returns a boolean because Google Apps Script doesn't support String.prototype.includes() in the same way that it doesn't support several of the additions introduced in ECMAScript 2015 Related Google Apps Script Javascript compatibility error can't locate ; syntax error Reference Basic JavaScript Features


0

Nowadays there is the Google Sheets have a "protection" feature that could be applied to sheets and ranges. To apply it automatically you could use Google Apps Script and a time-driven installable trigger. Reference https://developers.google.com/apps-script/guides/sheets https://developers.google.com/apps-script/guides/triggers/installable


1

I realized that the problem was just that I defined the variable for the columns as "column" but then used a different variable in the code: "col". Simple user error. :) The correct formula is as follows: function onEdit(e) { var column = e.range.getColumn(); var row = e.range.getRow(); if ( column >= 4 && col <= 10 ) { if ( row &...


0

It may not be the most elegant, but one approach could be to set a Data Validation sheet that will filter based on what you enter into that row. Once something is entered, the filter pulls related ID #s, and the data validation references that. This only works if you are entering this for a single cell reference though, as you might for a quick lookup. Use ...


1

Here's how to open multiple urls in different new browser tabs: It creates html script to do the job. Be sure the urls each begin with the protocol (e.g., not just 'www') or google will get confused. The function takes an array of urls. Those can come from anywhere including getValues() where you've got multiple urls on a row in a spreadsheet, or anywhere ...


0

I don't think that it's possible to log the click of the built-in close button in a Google Apps Script custom dialog. The alternative is to add a custom button in your custom dialog that does what you are looking for before closing the dialog by using google.script.host.close().


Top 50 recent answers are included