google-apps-script

Can the “initialData” property be used to write App Script parameters to a Stackdriver message?

风流意气都作罢 提交于 2021-02-10 03:31:05
问题 Summary Google suggests that App Script parameters (among other data) can be written to Stackdriver using a JSON object with a "initialData" property. But it doesn't seem to work. Issue Example This Google page contains an example function that illustrates the different ways information can be written to Stackdriver. An extract from their own code is below: var parameters = { isValid: true, content: 'some string', timestamp: new Date() }; console.log({message: 'Function Input', initialData:

Can the “initialData” property be used to write App Script parameters to a Stackdriver message?

淺唱寂寞╮ 提交于 2021-02-10 03:27:23
问题 Summary Google suggests that App Script parameters (among other data) can be written to Stackdriver using a JSON object with a "initialData" property. But it doesn't seem to work. Issue Example This Google page contains an example function that illustrates the different ways information can be written to Stackdriver. An extract from their own code is below: var parameters = { isValid: true, content: 'some string', timestamp: new Date() }; console.log({message: 'Function Input', initialData:

Programmatically delete a Google Apps Script time-based trigger by trigger name?

纵然是瞬间 提交于 2021-02-08 13:15:22
问题 How can I programmatically delete a Google Apps Script time-based trigger by the triggered function's name, instead of triggerarray id? I am creating a trigger and later on I want to delete the trigger by name. I tried this: ScriptApp.deleteTrigger("myfunction"); but it does not work. I don't want to use this method: var triggers = ScriptApp.getProjectTriggers(); ScriptApp.deleteTrigger(triggers[0]); Since I have more than one trigger at same time and might delete the wrong one! So how to

I want to write a script to read and log values of a specific row and copy them to a new sheet

半世苍凉 提交于 2021-02-08 12:12:41
问题 I want to build a script to automate creating a form out of specific values. What I need to do is: Ask the user which row is relevant for the form, enter the row in a text box Log value of column A of that row (Date) Check that row from column C-ZZZ for values (numbers) if there is a cell with a value, log the value. If the cell is empty ignore it If there is a value in a cell additionally log values of row 1-10 of that column (numbers + strings) create a new sheet copy logged values in a

Access data in Google App Script from spread sheet modal html form

老子叫甜甜 提交于 2021-02-08 12:12:36
问题 I have Google spreadsheet script which will show modal dialog using SpreadsheetApp.getUi().showModalDialog using a html form which is created as a file in the SpreadSheet Script project. This is how my Google Script project structure is : --Code.gs | |- openFormModalDialog() |- fetchData() |- updateSheet() | --form.html When click button in my form.html which is showed in the modal from the Code.gs I wan to call a function in my Code.gs to process the data entered by the user in the form. I

I want to write a script to read and log values of a specific row and copy them to a new sheet

女生的网名这么多〃 提交于 2021-02-08 12:10:31
问题 I want to build a script to automate creating a form out of specific values. What I need to do is: Ask the user which row is relevant for the form, enter the row in a text box Log value of column A of that row (Date) Check that row from column C-ZZZ for values (numbers) if there is a cell with a value, log the value. If the cell is empty ignore it If there is a value in a cell additionally log values of row 1-10 of that column (numbers + strings) create a new sheet copy logged values in a

Populate bulk data from google spreadsheet into google form dropdown list

家住魔仙堡 提交于 2021-02-08 12:09:23
问题 I have a google form with multiple sections, each section with a dropdown list. I wish to pull the data for the dropdown lists from spreadsheet with matching name. This is the script i run but it doesn't seems to be working. function getDataFromGoogleSheets() { const ss = SpreadsheetApp.getActiveSpreadsheet(); const sheet = ss.getSheetByName("DATA"); const [header, ...data] = sheet.getDataRange().getDisplayValues(); const choices = {} header.forEach(function(title, index) { choices[title] =

Google Script Performance Slow Down

廉价感情. 提交于 2021-02-08 11:47:18
问题 I'm new to Google script. Anyone can give some advice how to improve the coding performance? If the numOfEmail variable is quite a huge number then the performance will slow down. for (var i = 0; i < numOfEmail; i++) { var messages=threads[i].getMessages(); for (var j = 0; j < messages.length; j++) { sheet.getRange("A"+(lastEntry+i)).setValue(messages[j].getId()); sheet.getRange("B"+(lastEntry+i)).setValue(messages[j].getDate()); sheet.getRange("C"+(lastEntry+i)).setValue(messages[j].getFrom(

Google Apps script not working in an embedded iframe

只谈情不闲聊 提交于 2021-02-08 11:42:50
问题 I have a Google sheet where I have placed a few buttons linking to the script. It works fine when I use it on the sheets page. But when I publish it and embed the sheet on my website, the button doesn't work. It's not performing. Below is the sample code I use to move from one sheet to another with the click of the button and the iframe code I am using. function goToInward() { var spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); spreadsheet.setActiveSheet(spreadsheet.getSheetByName(

Address unavailable for UrlFetchApp.fetch in Google Apps Script

孤街醉人 提交于 2021-02-08 11:39:33
问题 First of all, many thanks to Google for the awesome Google Apps Script! I am currently designing a Google Sheets ad-on with a API service named CryptoCompare. So far it has always worked out quite well. But suddenly I get the error "Address unavailable". I tried different endpoints, new API keys and even new Google Sheets. But nothing works. This simple call fails: var response = UrlFetchApp.fetch('https://min-api.cryptocompare.com/data/blockchain/list'); Btw: Other APIs (such as Coinbase,