google-apps-script

How to copy data from Gmail message attachment to a spreadsheet?

亡梦爱人 提交于 2020-08-20 05:39:06
问题 I'm trying to get the data out of a CSV report, located in a specific folder from a shared email and replace the old data from a specific tab in Google Sheets with new ones. I already tried different solutions, but none seems to get me where I want. The code below is the cleanest that I produced but, for some reason, is not doing anything. Steps that I followed: Open email where the folder is located(it is a shared email, managed in Gmail) Search for the folder where is located (label:rpt-its

Create list of all sheet names in Google Apps Scripts

寵の児 提交于 2020-08-19 17:04:16
问题 My goal I have two spreadsheets, SpreadSheetA and SpreadSheetB. I am trying to get a list of the names of all the sheets in SpreadSheetA and add it to the active sheet in SpreadSheetB. My progress so far I have the code done but keep getting an error message when I run it. The error message is "Cannot convert Array to Object[][]" in reference to the line range.setValues(sheetNameArray); . Here is my code: function getSheetNamesAndAddToOtherSheet() { var spreadSheetAURL = "https://docs.google

TypeError: Cannot read property “source” from undefined

我的梦境 提交于 2020-08-19 10:56:12
问题 I've searched through the forums a few times and I wasn't able to suss out an answer to my issue. I'm using Google Sheets to track project progress for my team. I currently have 5 users, each with their own tab, plus three additional tabs that are intended to be dynamic though fairly hands-off for any user except myself. In order to make this tracker easy to use, I've implemented an onEdit script to move any project that's marked "completed" from the user's tab over to the "completed" tab

TypeError: Cannot read property “source” from undefined

妖精的绣舞 提交于 2020-08-19 10:53:59
问题 I've searched through the forums a few times and I wasn't able to suss out an answer to my issue. I'm using Google Sheets to track project progress for my team. I currently have 5 users, each with their own tab, plus three additional tabs that are intended to be dynamic though fairly hands-off for any user except myself. In order to make this tracker easy to use, I've implemented an onEdit script to move any project that's marked "completed" from the user's tab over to the "completed" tab

Google Apps Script does not load when embedded into iFrame

隐身守侯 提交于 2020-08-17 12:19:51
问题 I am trying to embed my Google Apps Script WebApp into an iFrame on another domain but the webapp is not loaded and I only see a white screen. There is also no error in the webinspector. The Webapp is published with: Execute as m e and Access has anyone within Given Domain. According to this I implemented my doGet method like this: function doGet(e) { return HtmlService .createHtmlOutputFromFile('html/index') .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); } and the IFrame

Google Apps Script does not load when embedded into iFrame

淺唱寂寞╮ 提交于 2020-08-17 12:16:51
问题 I am trying to embed my Google Apps Script WebApp into an iFrame on another domain but the webapp is not loaded and I only see a white screen. There is also no error in the webinspector. The Webapp is published with: Execute as m e and Access has anyone within Given Domain. According to this I implemented my doGet method like this: function doGet(e) { return HtmlService .createHtmlOutputFromFile('html/index') .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); } and the IFrame

“canvas1.getContext is not a function” error when creating a canvas element via XmlService

青春壹個敷衍的年華 提交于 2020-08-17 09:08:49
问题 I have been working on making projects inside Google Apps Script but came across a problem. I am currently trying to get the individual pixels of an image, by using an HTML canvas(if you know of another way to get pixel data from an image in JS, please let me know). The problem is, Google Apps Script doesn't seem to have a getContext method for the canvas. I'm not sure if this is done purposely, or if it is some kind of bug. Code: var img = XmlService.createElement('img'); img.src = query;

Is there a faster way to refresh all of my custom formulas?

时光总嘲笑我的痴心妄想 提交于 2020-08-17 06:00:09
问题 I need to refresh all of my custom formulas via a script in Google Sheets but this seems to take forever (like, 30 seconds for 100 cells). There will potentially be thousands of cells with my custom formula so I must come up with a better way. I have: function refresher(){ var sheet = SpreadsheetApp.getActiveSheet(); var selection = sheet.getDataRange(); var columns = selection.getNumColumns(); var rows = selection.getNumRows(); for (var column=1; column <= columns; column++){ for (var row=1;

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