google-apps-script

The coordinates of the target range are outside the dimensions of the sheet

邮差的信 提交于 2020-03-04 20:51:33
问题 I use this code and while in the past it worked well, today I received this error message: The coordinates of the target range are outside the dimensions of the sheet. (line 27, ___.gs) My code is not too complex: function onEdit() { var sheetNameToWatch1 = "Assign_Page"; var columnNumberToWatch = 19; var valueToWatch = "Delivred"; var sheetNameToMoveTheRowTo = "K_Delivery_Archive"; var sheetNameToMoveTheRowTo2 = "Buffering"; var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet =

Is there a way to sort this Google scripts function numerically/opposite direction?

泄露秘密 提交于 2020-03-04 15:34:05
问题 Here is the script that I'm using to pull all the sheet names of a Google Sheet Document into a list on a front sheet. It is working; however, is there a way to sort this the opposite way? I have the sheets named by date with the oldest date as the furthest sheet and the newest sheet the closest to the front. So it is sorting the newest date first but I would like it to sort with the oldest date first. Also, is there a way to make this function dynamic so it updates as new sheets are added or

How do I automatically remove all protections that exist on a cell in Google Sheets when I (the owner of the workbook) clear its contents?

妖精的绣舞 提交于 2020-03-04 06:19:07
问题 I'm currently using Google Sheets as a way for people to sign up for certain time shifts. I'm using the following script to automatically protect cells after data entry so that people can't discretely erase their signups without notifying me: function onEdit(e) { var range = e.range; var timeZone = Session.getScriptTimeZone(); var stringDate = Utilities.formatDate(new Date(), timeZone, 'dd/MM/yy HH:mm'); var description = 'Protected on ' + stringDate; var protection = range.protect()

Google Apps Script FileUpload() without FormPanel?

二次信任 提交于 2020-03-04 05:27:19
问题 I am in the process of building my first application that makes use of Google Apps Script. I need to have a form that allows the upload of a file to a Google Documents List. I currently have this working using code based on the Google Apps Script FileUpload docmentation : function doGet(e) { var app = UiApp.createApplication().setTitle("Upload CSV to Sheet"); var form = app.createFormPanel().setId('frm').setEncoding('multipart/form-data'); var formContent = app.createVerticalPanel(); form.add

Google Apps Script PERMISSION_DENIED with sheets addon

你说的曾经没有我的故事 提交于 2020-03-04 05:05:19
问题 I tried to implement a simple "Multi selector sidebar" extension based on THIS SHEET which I found in this Google support thread When I copy the sheet it works fine but when I try to put the exact same code in my real sheet, it doesn't work anymore. It throws an error when I try to access the GA function from within the template. I have created a simplified test project which also fails to work for me. To reproduce the error: Create a new Spreadsheet at https://docs.google.com/spreadsheets/

Google Apps Script PERMISSION_DENIED with sheets addon

ⅰ亾dé卋堺 提交于 2020-03-04 05:05:10
问题 I tried to implement a simple "Multi selector sidebar" extension based on THIS SHEET which I found in this Google support thread When I copy the sheet it works fine but when I try to put the exact same code in my real sheet, it doesn't work anymore. It throws an error when I try to access the GA function from within the template. I have created a simplified test project which also fails to work for me. To reproduce the error: Create a new Spreadsheet at https://docs.google.com/spreadsheets/

How to move data from Sheet 1 to Sheet 2 and append Sheet 1 data above old Sheet 2 data

时光怂恿深爱的人放手 提交于 2020-03-04 03:43:29
问题 I am having an issue getting my data from s = ss.getSheetByName('Last Seven Days'); to append to the top of ts = tss.getSheetByName('History'); . My xp in this area is very low so may need a bit of hand-holding while I get my head around it. Currently I can only get my function saveToHistory to append the data from 'Last Seven Days' to the bottom of the 'History Sheet' with the below script: function saveToHistory() { var ss, s, r, v, target,ts,tss; ss = SpreadsheetApp.getActive(); s = ss

How to force flush a user's input?

余生颓废 提交于 2020-03-03 11:36:33
问题 I was wondering if it is possible to force flush of a user input from a script. The context is the following : I have a sheet in which people are supposed to input data, and a button where they click when they are done, which will process the data. It happens that sometimes people double click a cell, write what they want, but then they click the button before hitting return. Thus the script sees the cell as still empty. Would there be a way to either force flush with what they have currently

How to force flush a user's input?

廉价感情. 提交于 2020-03-03 11:35:11
问题 I was wondering if it is possible to force flush of a user input from a script. The context is the following : I have a sheet in which people are supposed to input data, and a button where they click when they are done, which will process the data. It happens that sometimes people double click a cell, write what they want, but then they click the button before hitting return. Thus the script sees the cell as still empty. Would there be a way to either force flush with what they have currently

Why does Google script for each run differently for range in a row vs range in a column

淺唱寂寞╮ 提交于 2020-03-03 07:30:27
问题 I am trying to create a list of tabs based on values in a row, as I have previously done with values in a column (The script here is an example test as I was trying to identify the issue, not the actual script used). However, the forEach() function is working differently and I do not understand why. Below I will append two sets of scripts and their results. For column : var app = SpreadsheetApp; var ss = app.getActiveSpreadsheet(); var sheet = ss.getActiveSheet(); var range = sheet.getRange(1