google-apps-script

How can I extract Information in a Google Sheet from a xlsx gmail attachment via google apps script

我的梦境 提交于 2021-01-01 09:16:40
问题 I want to extract the content from an xlsx gmail attachment via google apps script. And then put the information into a Google Sheet. It's working fine for CSV files, but I don't get the content of a xlsx file. 回答1: Unlike csv files, xlsx file data cannot be directly inserted into a spreadsheet What you can do instead: Save the attachment on your disc in its original mimeType Convert it to a Google Sheets document with e.g. Drive.Files.copy Delete the excel file from your disc Sample:

Google sheet: import a library (CryptoJS)

橙三吉。 提交于 2021-01-01 08:15:53
问题 I'm using the google sheet webscript to manipulate spreadsheet data and I want to use the following function to encrypt certain cells: var encrypted = CryptoJS.AES.encrypt("message", "Secret key"); There's an option to add libraries to the Google Sheet webscript but I have no idea how to get a library installed. According to the Google documentation you need the project key/script ID in order to use the library, but I have not been able to find this kind of information. Can someone assist in

Web App call fails with “… Error code INTERNAL” with Custom API

本小妞迷上赌 提交于 2021-01-01 07:45:27
问题 I have a spreadsheet with a collection of cards, and I wrote a doGet() function to pick a random one, and return it to the user. When entering the Web App url into a web browser, the result appears fine. However, when I try to make a HTTP Get request through the request module, it returns this: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Error</title><style type="text/css">body {background-color: #fff; margin: 0; padding:

Web App call fails with “… Error code INTERNAL” with Custom API

时光怂恿深爱的人放手 提交于 2021-01-01 07:42:12
问题 I have a spreadsheet with a collection of cards, and I wrote a doGet() function to pick a random one, and return it to the user. When entering the Web App url into a web browser, the result appears fine. However, when I try to make a HTTP Get request through the request module, it returns this: <!DOCTYPE html><html><head><link rel="shortcut icon" href="//ssl.gstatic.com/docs/script/images/favicon.ico"><title>Error</title><style type="text/css">body {background-color: #fff; margin: 0; padding:

Google Sheets Script: email with a HTML Table that only has a set of

五迷三道 提交于 2021-01-01 07:09:00
问题 In Google Spreadsheet I want to be able to send a email with a HTML Table within the Email. I have accomplished this below and would like to now extend the functionality more. Now I am trying to understand / find a way on how to filter the getRange based on a variable. Example: If Column C = Todays Date I want to return all rows with Todays date into the HTML Table in the Email. I have been playing with the GetRange but when adjusting it something other then a Range it breaks. How should I go

Google Sheets Script: email with a HTML Table that only has a set of

五迷三道 提交于 2021-01-01 07:07:51
问题 In Google Spreadsheet I want to be able to send a email with a HTML Table within the Email. I have accomplished this below and would like to now extend the functionality more. Now I am trying to understand / find a way on how to filter the getRange based on a variable. Example: If Column C = Todays Date I want to return all rows with Todays date into the HTML Table in the Email. I have been playing with the GetRange but when adjusting it something other then a Range it breaks. How should I go

SpreadsheetApp how to return unique values from an array

 ̄綄美尐妖づ 提交于 2021-01-01 06:37:46
问题 Here is the function I made. The var myArray is a list of names. I'm not able to get only unique values from this array and set it to another sheet. I just want the names once. function array() { var app = SpreadsheetApp; var ss = app.getActiveSpreadsheet().getSheetByName("test"); var destinationSheet = app.getActiveSpreadsheet().getSheetByName("test2"); var myArray = ss.getRange(2,1,30).getValues(); destinationSheet.getRange(2, 1, 30).setValues(myArray); } Can someone help me to filter this

SpreadsheetApp how to return unique values from an array

风流意气都作罢 提交于 2021-01-01 06:36:31
问题 Here is the function I made. The var myArray is a list of names. I'm not able to get only unique values from this array and set it to another sheet. I just want the names once. function array() { var app = SpreadsheetApp; var ss = app.getActiveSpreadsheet().getSheetByName("test"); var destinationSheet = app.getActiveSpreadsheet().getSheetByName("test2"); var myArray = ss.getRange(2,1,30).getValues(); destinationSheet.getRange(2, 1, 30).setValues(myArray); } Can someone help me to filter this

ARRAYFORMULA with getNotes

a 夏天 提交于 2021-01-01 06:30:32
问题 Is it possible to use an Arrayformula to populate the entire column on the formula "getNotes"? https://developers.google.com/apps-script/reference/spreadsheet/range#getNotes() So far I've added the small function on Apps Script as follows: function getNotes(cell) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var range = ss.getRange(cell) return range.getNotes(); } Then populated the column's first cell as follows: =ARRAYFORMULA(IFERROR(getNotes(Address(row(B1:B), column(B1:B))))) which

ARRAYFORMULA with getNotes

烂漫一生 提交于 2021-01-01 06:28:54
问题 Is it possible to use an Arrayformula to populate the entire column on the formula "getNotes"? https://developers.google.com/apps-script/reference/spreadsheet/range#getNotes() So far I've added the small function on Apps Script as follows: function getNotes(cell) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var range = ss.getRange(cell) return range.getNotes(); } Then populated the column's first cell as follows: =ARRAYFORMULA(IFERROR(getNotes(Address(row(B1:B), column(B1:B))))) which