google-apps-script

Splitting single column into multiple columns 1000 rows per column

◇◆丶佛笑我妖孽 提交于 2021-01-28 08:12:42
问题 I have an extremely large column of data that I want to split into multiple columns of 1000 rows each. I have combed the internet for any possible answer, and am unable to find a solution. Example: Columns Before I want to take the above column and split it into multiple columns of 3 rows, so that it resembles: Columns After I realize something like this would require a script. Any ideas? I've done it in Excel before, but not Google Sheets. 回答1: =ARRAYFORMULA(VLOOKUP(TRANSPOSE(SEQUENCE

Google App Script and public locks

泄露秘密 提交于 2021-01-28 08:06:08
问题 I have a spreadsheet that I have a doGet() a doPost() as well as a timed trigger to do some updates. I want these to block each other. Yay the LockService... hopefully. The Google documentation on the LockService does not document the getPublicLock() method and I can't seem to find anything specific to my needs. The documentation above does say that getDocumentLock() will return null in a web app which is not particularly useful, and general posts around the interweb suggest that it will stop

Is there a way to print multiple tabs of a spreadsheet (but not all of them) as a single pdf?

拈花ヽ惹草 提交于 2021-01-28 07:55:01
问题 I've done some research but haven't found any way to do this. Tried to do what Andrew Roberts explains here http://www.andrewroberts.net/2017/03/apps-script-create-pdf-multi-sheet-google-sheet/ to convert the spreadsheet (or a specific tab) to pdf: function convertSpreadsheetToPdf(email, spreadsheetId, sheetName, pdfName) { var spreadsheet = spreadsheetId ? SpreadsheetApp.openById(spreadsheetId) : SpreadsheetApp.getActiveSpreadsheet(); spreadsheetId = spreadsheetId ? spreadsheetId :

Improving Count, CountIF Google Sheets formulas

血红的双手。 提交于 2021-01-28 07:53:27
问题 I have created a google sheets. There are multiple sheets (Tabs) inside single google sheet. I have one sheet called Dashboard There are other sheets like kkweb , virtual . Currently there are 2 other sheets except dashboard. All the 2 sheets has same columns & structure, Even new sheets will have same columns & structure. I want to perform some calculations on dashboard sheet. Count Total Tasks =COUNT(kkweb!B5:B,virtual!B5:B) Count Total "New Requests" =(COUNTIF(kkweb!D5:D,"New Requests")) +

How to check spelling and grammar in Google Apps Script

早过忘川 提交于 2021-01-28 07:43:30
问题 How can I delete all rows containing a spelling or grammar error in a Google sheet? I'd prefer doing this through Google Apps Script. What I've considered: Using the spell checker from the Tools menu is too slow since I have a few tens of thousands of rows. I've found this stackoverflow post, but my situation differs in that I do not need any popup bubbles, don't have a backend to provide the spell checking, and would very strongly prefer this be in Google Apps Script since I already have the

Google Apps Script - send pdf in email

自作多情 提交于 2021-01-28 07:39:47
问题 I have a script that sends an email. I would like to set it up so that the email is sent with a pdf attachment that is in my google drive. The name of the file is pdfholder.pdf Here is the code that is currently working (without attachment), and sending emails MailApp.sendEmail(userEmail, subject, message); Here is the code that is not working (with the attachment), and not sending emails var file = DocsList.getFileById('pdfholder'); MailApp.sendEmail(userEmail, subject, message, {attachments

Auto Sync google sheets to firebase without button

夙愿已清 提交于 2021-01-28 07:32:33
问题 I used a tutorial to help me sync my sheets to firebase with the use of a SYNC button that activates the script. The SYNC button currently sits just in the middle of the spreadsheet. I want to sync the data from sheets automatically to firebase when there are changes made. function getFirebaseUrl(jsonPath) { return ( 'https://no-excusas.firebaseio.com/' + jsonPath + '.json?auth=' + secret ) } function syncMasterSheet(sheetHeaders, sheetData) { /* We make a PUT (update) request, and send a

Auto Sync google sheets to firebase without button

拜拜、爱过 提交于 2021-01-28 07:21:04
问题 I used a tutorial to help me sync my sheets to firebase with the use of a SYNC button that activates the script. The SYNC button currently sits just in the middle of the spreadsheet. I want to sync the data from sheets automatically to firebase when there are changes made. function getFirebaseUrl(jsonPath) { return ( 'https://no-excusas.firebaseio.com/' + jsonPath + '.json?auth=' + secret ) } function syncMasterSheet(sheetHeaders, sheetData) { /* We make a PUT (update) request, and send a

Google sheets: Run script to another sheet via button

我与影子孤独终老i 提交于 2021-01-28 07:09:08
问题 I'm currently working on this thread. The code seems to work with the active sheet, but how can I make it work if the button for lock and unlock are located on another sheet? This is the sheet where the button is located. So, column B is the sheet name. Is it possible for the button in column C to only work with the sheet in line with the button? Here's the code: function Unlock() { var sheet = SpreadsheetApp.getActiveSheet(); var protection = sheet.protect().setDescription('Sample protected

Google Apps Script - How to get corresponding record in destination spreadsheet in onFormSubmit (Google Forms Event)?

匆匆过客 提交于 2021-01-28 07:04:18
问题 I catch this event when a respondent sends a response https://developers.google.com/apps-script/guides/triggers/events#form-submit_4 Inside this function, I want to add some information into the corresponding row (Google creates this row automatically) in the destination spreadsheet In order to do that, first I need to find this row The best way I can find at the moment is by using sheet.getLastRow() https://developers.google.com/apps-script/reference/spreadsheet/sheet#getlastrow But there is