google-apps-script-editor

Apps Script debugger won't let me look at values in objects (including arrays and block scopes)

删除回忆录丶 提交于 2020-08-15 05:41:31
问题 I'm trying to debug an Apps Script project, and for the past 2–3 days, the debugger hasn't let me look at variables defined at the scope level. For example, I was trying to debug this code. /** * Deletes all rows in a sheet, excluding header rows. Just calling sheet.deleteRows() * for a massive range of rows will throw out an error. * @private * * @param {Sheet} sheet * @param {number = 0} numHeaderRows * @param {number = 500} deletionSize - The number of rows to delete at a time */ function

Apps Script debugger won't let me look at values in objects (including arrays and block scopes)

ぃ、小莉子 提交于 2020-08-15 05:40:41
问题 I'm trying to debug an Apps Script project, and for the past 2–3 days, the debugger hasn't let me look at variables defined at the scope level. For example, I was trying to debug this code. /** * Deletes all rows in a sheet, excluding header rows. Just calling sheet.deleteRows() * for a massive range of rows will throw out an error. * @private * * @param {Sheet} sheet * @param {number = 0} numHeaderRows * @param {number = 500} deletionSize - The number of rows to delete at a time */ function

Session.getActiveUser().getEmail() returns no Value

六眼飞鱼酱① 提交于 2020-07-30 07:56:48
问题 this is my first Stackoverflow Questions, so I'm trying to do my best to be clear and structured here but please forgive me for beginner mistakes :) So I'm having a little issue with the Script Editor of Google, basically I'm calling the Session.getActiveUser().getEmail() as well as the Session.getEffectiveUser().getEmail() Function yet none of them is returning a value. Here's the full Code I'm using: function onEdit(e){ var email = Session.getActiveUser().getEmail(); var range = e.range;

Google Apps Script V8 assignment to null cancels debugging

。_饼干妹妹 提交于 2020-06-27 08:45:49
问题 A variable assignment to null causes debugging to cancel execution at that line. Here is a test script that reproduces the problem: function myFunction() { var a = "Hallo"; Logger.log("a=" + a); var b = null; Logger.log("b=" + b); } When debugging this script execution is cancelled on line "var b = null;". Log output is: Mar 11, 2020, 8:52:49 PM Info a=Hallo Mar 11, 2020, 8:52:54 PM Info Execution cancelled. The result is the same when stepping over the line and running past the line in debug

App Script My Executions Entries Delayed/Missing

一曲冷凌霜 提交于 2020-05-16 21:58:10
问题 Recently, I've been having issues with My Executions having delays in adding the execution entries. The app script on the Google Sheet will run successfully (based on output), but there is no entry in the execution logs or the entry is delayed (10+ minutes). More worrisome, today I received an automatically generated email with a script error: "We're sorry, a server error occurred. Please wait a bit and try again." But there was no corresponding entry in executions. I've tried checking View

Disable or reset the Execution Transcript in Google Apps Script

…衆ロ難τιáo~ 提交于 2020-04-30 13:58:23
问题 Is it possible to disable or reset the Execution Transcript in Google Apps Script? If not, what would be the best way to run a script that requires sensitive access tokens for API calls? 回答1: Use a time-based trigger to invoke a simple dummy script: function clearIt() { Logger.log("hi"); } This script could be invoked every minute, or specifically invoked via one-time trigger to occur after specific other functions. If you go the one-time route you'll need to delete the invoking trigger to

Using Google Sheets scripts, why does my if statement always return false when comparing cell values?

瘦欲@ 提交于 2020-04-11 05:44:27
问题 I need to compare two cell values and act on them if they are different. My "if" statement always returns false when comparing the cell contents however, and I can't figure out why: function onEdit() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName('Sheet1'); // apply to sheet name only var testvalues = sheet.getRange('A1:A2').getValues(); // array of values to be tested var testvalue1 = testvalues[0]; // The contents from A1 var testvalue2 = testvalues[1]; //

Google Sheets Script permissions for everyone allowed access to a sheet

末鹿安然 提交于 2020-02-06 08:29:47
问题 I know there are a lot of questions out there related to Google Scripts and some of them touch on my issue but I can't seem to figure out the full answer. I only want to be able to run 1 or 2 scripts in the same project file for 1 spreadsheet. How do I allow permission for everyone with whom the sheet is shared WITHOUT forcing each user to go through the process of allowing Authorization? Is this possible? Maybe there is an alternative script? Here is my script (in case this helps): function

Trigger an email when a cell is a certain colour?

℡╲_俬逩灬. 提交于 2020-01-24 22:06:06
问题 I have very VERY limited knowledge on this. So little I probably shouldn't even refer to it as "knowledge" This is what I'm trying to do: I have a column with dates referring to send dates. If the date has already passed, the cell turns red (#a33838). I want to send an email if a cell in that column turns red, so that I know it has not been sent, and needs doing. I also want the email to hold the information of the row that cell is in I have been looking through the forums and I think I need

How to stop code from moving two rows at a time when checkbox is true?

谁都会走 提交于 2020-01-17 14:05:16
问题 I'm working on a spreadsheet for my boss and I've been trying to add a feature where the entire row moves from Sheet1 to Sheet2 when the checkbox in column1 is checked. The code I'm using works, except sometimes it moves two rows at once even though only one box is checked. Here's my code: function onEdit(event) { // assumes source data in sheet named Sheet1 // target sheet of move to named Sheet2 // test column with yes/no is col 1 or A var ss = SpreadsheetApp.getActiveSpreadsheet(); var s =