google-apps-script

Checking if a sheet cells includes errors or not

牧云@^-^@ 提交于 2020-07-10 07:07:14
问题 I am using this script function to check if my cell functions in google sheet has any errors or not. Here is the code but it does not seems to be working. It keeps on saying no error when i have an error in a cell var ss = SpreadsheetApp.getActiveSpreadsheet(); var sourcename = "Sheet1"; var source = ss.getSheetByName(sourcename); var cell = source.getRange("A1:AG30"); function isError2(cell) { const errorValues = ["#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A","#ERROR!"];

Checking if a sheet cells includes errors or not

好久不见. 提交于 2020-07-10 07:06:08
问题 I am using this script function to check if my cell functions in google sheet has any errors or not. Here is the code but it does not seems to be working. It keeps on saying no error when i have an error in a cell var ss = SpreadsheetApp.getActiveSpreadsheet(); var sourcename = "Sheet1"; var source = ss.getSheetByName(sourcename); var cell = source.getRange("A1:AG30"); function isError2(cell) { const errorValues = ["#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A","#ERROR!"];

Checking if a sheet cells includes errors or not

房东的猫 提交于 2020-07-10 07:04:07
问题 I am using this script function to check if my cell functions in google sheet has any errors or not. Here is the code but it does not seems to be working. It keeps on saying no error when i have an error in a cell var ss = SpreadsheetApp.getActiveSpreadsheet(); var sourcename = "Sheet1"; var source = ss.getSheetByName(sourcename); var cell = source.getRange("A1:AG30"); function isError2(cell) { const errorValues = ["#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A","#ERROR!"];

How to call a Google Sheet formula from within a custom function?

拥有回忆 提交于 2020-07-10 03:19:18
问题 Is it possible to call any of the Google Sheets formulas from within your own Google Apps script custom function? If so, how? It obviously doesn't work to merely use the formula name like you would inside the sheet. Like this, which is what I was hoping would work: function myCustomFunction() { return TDIST(1,30,1); // calling =myCustomFunction() does not work due to TDIST giving a ReferenceError, even though =TDIST(1,30,1) works inside the spreadsheet } But since Google's built-in formulas

How to call a Google Sheet formula from within a custom function?

▼魔方 西西 提交于 2020-07-10 03:18:55
问题 Is it possible to call any of the Google Sheets formulas from within your own Google Apps script custom function? If so, how? It obviously doesn't work to merely use the formula name like you would inside the sheet. Like this, which is what I was hoping would work: function myCustomFunction() { return TDIST(1,30,1); // calling =myCustomFunction() does not work due to TDIST giving a ReferenceError, even though =TDIST(1,30,1) works inside the spreadsheet } But since Google's built-in formulas

“Attribute provided with no value” error - UrlFetchApp

馋奶兔 提交于 2020-07-09 14:51:10
问题 I have the following error : Attribute provided with no value The error is from line: var content = UrlFetchApp.fetch(url).getContentText(); Here is my code : function getArray() { var newData = new Array(); var sheet = SpreadsheetApp.openById('my_id').getSheetByName('Sheet2'); var urls = sheet.getRange("A1:A").getValues(); var fromText = '<span class="nb-shares">'; var toText = '</span>'; for(var i = 0; i < urls.length; i++){ var url = urls[i]; var content = UrlFetchApp.fetch(url)

HTML Service does not open a sidebar in V8 runtime

守給你的承諾、 提交于 2020-07-09 13:24:45
问题 I have a very large project running on Rhino, but when I switch it to V8 one of the basic functionalities break - the sidebar in Google Sheets can no longer be opened. Basic architecture: A) Google Sheet A with a script (Rhino) importing a GAS Library (V8). The sidebar is in the Library. versus B) Google Sheet B with a script (V8) importing a GAS Library (V8). The sidebar is in the Library. This code is in the Library (standalone script file, running in V8): // called from parent script as

HTML Service does not open a sidebar in V8 runtime

感情迁移 提交于 2020-07-09 13:24:26
问题 I have a very large project running on Rhino, but when I switch it to V8 one of the basic functionalities break - the sidebar in Google Sheets can no longer be opened. Basic architecture: A) Google Sheet A with a script (Rhino) importing a GAS Library (V8). The sidebar is in the Library. versus B) Google Sheet B with a script (V8) importing a GAS Library (V8). The sidebar is in the Library. This code is in the Library (standalone script file, running in V8): // called from parent script as

Does Google Apps Script V8 engine support Promise?

一个人想着一个人 提交于 2020-07-09 13:20:29
问题 They say V8 engine is a proper Javascript ES5 engine. Does it support ES5 features like Promise? 回答1: Apps script V8 recognizes the new function definition formats, for example: let letAsyncFunction = async function() { //Your logic here } It asynchronously returns the result of the function evaluations, pretty much like a Promise. In other words, when the function async is called, it returns a promise. Also await is used for calling an async function and wait for it to resolve or reject

Handling Gmail Addon Timeouts

一笑奈何 提交于 2020-07-09 12:52:26
问题 I'm trying to upload a larger size document from a gmail add on but I keep getting "Gmail could not perform this add-on action" when I try to hit my endpoint because it takes too long and I "Exceeded maximum execution time" of 30 seconds. Is there a way to increase the maximum execution time or at least catch the error and display something else other than Gmail's runtime error message? 回答1: I found some Google documentation that sheds light on this issue. Check out the Callback Function