google-apps-script

For Loops timing out: JavaScript / Google Apps Script

放肆的年华 提交于 2021-02-13 17:27:26
问题 So I am have this issue with Google Apps Script. It is timing out because the app server requests are taking too long. I was just wanting to see if my coding could be cleaned up a bit to run faster or is there another method which would work? Code below: for (var y = 1; y < listLast ; y++) { var matchor = listSheet.getRange("B" + y).getValue(); var listEmCo = listSheet.getRange("A" + y).getValue(); if(matchor == "Match") { Logger.log("Do Nothing"); } else { for (var x = 0; x < formLast; x++)

For Loops timing out: JavaScript / Google Apps Script

青春壹個敷衍的年華 提交于 2021-02-13 17:26:50
问题 So I am have this issue with Google Apps Script. It is timing out because the app server requests are taking too long. I was just wanting to see if my coding could be cleaned up a bit to run faster or is there another method which would work? Code below: for (var y = 1; y < listLast ; y++) { var matchor = listSheet.getRange("B" + y).getValue(); var listEmCo = listSheet.getRange("A" + y).getValue(); if(matchor == "Match") { Logger.log("Do Nothing"); } else { for (var x = 0; x < formLast; x++)

email text passed to a function is interpreted as a class

左心房为你撑大大i 提交于 2021-02-13 17:05:54
问题 I am passing an email address text variable to a function. only when I pass a text with "org." in it, it is interpreted as a class function main() { var email = "name@surname.org.il"; receiveemail(email); } function receiveemail(email) { Logger.log('received a new email %s', email); } meaning, the email variable in function receiveemail looks like this: "name@surname.(class)" then I tried to pass the email as a text array function main() { var Text = new Array(); Text[0] = "name@surname.";

Google App Script - “message”: “Requested entity was not found.” with devMode = false

一个人想着一个人 提交于 2021-02-11 18:24:44
问题 I am trying to connect my Python script with my project in Google App Script. I have followed all the insctructions in this guide. I have of course deployed it as an executable API and have tested it with access to only myself, my organization and anyone options. When I pass the request with devMode as true , it all works fine. I understand that in this case, it is running the latest saved version. However when I set it to false then I get back the error "message": "Requested entity was not

Google App Script - “message”: “Requested entity was not found.” with devMode = false

风格不统一 提交于 2021-02-11 18:24:16
问题 I am trying to connect my Python script with my project in Google App Script. I have followed all the insctructions in this guide. I have of course deployed it as an executable API and have tested it with access to only myself, my organization and anyone options. When I pass the request with devMode as true , it all works fine. I understand that in this case, it is running the latest saved version. However when I set it to false then I get back the error "message": "Requested entity was not

Sending a “please wait” message in google hangouts chat

半世苍凉 提交于 2021-02-11 18:20:55
问题 I'm creating a google hangouts chatbot. I'm building the bot in Google Apps Script. The bot accesses some web apis that usually take a few seconds, but the wait can be disconcerting to the user who doesn't realize the system is not just ignoring them. I want to display a message like "please wait" before the results come in. But the event is triggered by onMessage and text is displayed as part of the return statement. Is there a way to show an immediate message and then the rest of the

Is the Lock by the LockService in google app script reentrant or non-reentrant?

半腔热情 提交于 2021-02-11 18:20:18
问题 I am experimenting on implementing a simple row level locking for google sheets. (Conscious about concurrent accesses butching the data. Am I just being paranoid?). I've come across the LockService and was planning on using it but was just curious what kind of lock it is. 回答1: Answer: LockService is a mutual-exclusion lock, which, if used to guard script-external data, such as the PropertiesService methods which do not use user-specific properties, allow the code to be re-entrant. The Lock

Is the Lock by the LockService in google app script reentrant or non-reentrant?

冷暖自知 提交于 2021-02-11 18:20:02
问题 I am experimenting on implementing a simple row level locking for google sheets. (Conscious about concurrent accesses butching the data. Am I just being paranoid?). I've come across the LockService and was planning on using it but was just curious what kind of lock it is. 回答1: Answer: LockService is a mutual-exclusion lock, which, if used to guard script-external data, such as the PropertiesService methods which do not use user-specific properties, allow the code to be re-entrant. The Lock

Duplicate worksheet with copy placed next to original

笑着哭i 提交于 2021-02-11 18:19:29
问题 I have a script to duplicate a sheet in the same spreadsheet: function duplicateSheet() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var devis = ss.getActiveSheet(); devis.copyTo(ss).setName('CopyDevis'); It works fine, however the copy tab is created at the very right of the spreadsheet. It is a bit of an issue because i have many tabs and i would have to go to the far right then move it back to the left. I want the copy to created right next to the original. I'm aware of the

Duplicate worksheet with copy placed next to original

我的梦境 提交于 2021-02-11 18:18:21
问题 I have a script to duplicate a sheet in the same spreadsheet: function duplicateSheet() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var devis = ss.getActiveSheet(); devis.copyTo(ss).setName('CopyDevis'); It works fine, however the copy tab is created at the very right of the spreadsheet. It is a bit of an issue because i have many tabs and i would have to go to the far right then move it back to the left. I want the copy to created right next to the original. I'm aware of the