google-apps-script

indexOf in google script

主宰稳场 提交于 2020-05-30 09:36:04
问题 I'm trying to use findIndex() on a object in google script but it does not work. Here is a exemple: function myFunction() { var searchingJohn = "John"; var DATA = {namesList: []}; DATA.namesList.push({name: "John", otherDataForThisName: []}); var result = DATA.namesList.findIndex(function (element) {return element.name == this;}, searchingJohn); return result; } this work well in a javascript consol but google script return me a "TypeError: Fonction findIndex not found in object....." 回答1:

Import CSV data into Google Sheets

两盒软妹~` 提交于 2020-05-30 08:13:10
问题 When trying to use the IMPORTDATA function for this file: https://www.kaggle.com/stefanoleone992/fifa-20-complete-player-dataset#players_20.csv An unexpected error occurs that says it is impossible to import data into the spreadsheet. Is there any other way that I can bring this data to my spreadsheet? This data would be very important to the work I'm doing. It would save me from almost 3 months of work to be able to type and copy everything and then filtering according to my need. It would

How to extract the link from a cell now that links are not reflected as HYPERLINK?

爱⌒轻易说出口 提交于 2020-05-29 07:43:51
问题 "Insert Link" is not producing a =HYPERLINK(’’,’’) anymore. Before if you linked a cell with a value ‘X’. It was converted into the formula =HYPERLINK( link ,’X’) Two days ago "Insert Link" changed. Now the content of the cell remains the same, it is just underlined. Using script, how can I extract the link from a Cell now that neither its value nor its formula contains this information? I searched the documentation but the only method related to links that I was able to find was

Export Google sheet Chart as an image

萝らか妹 提交于 2020-05-29 04:19:44
问题 Would you please help on how to export a chart to a image using google script. I wrote this code but it doesn't work. I'm worrying that the API getAs is deprecated. function TestEmailCharts(){ var sheet = SpreadsheetApp.getActiveSheet(); var charts = sheet.getCharts(); if(charts.length!=0) { var chartBlobs=new Array(charts.length); var emailBody="Charts<br>"; var emailImages={}; for(var i=0;i<charts.length;i++){ chartBlobs[i]= charts[i].getAs("image/jpeg").setName("chartBlob"+i); emailBody=

Export Google sheet Chart as an image

我们两清 提交于 2020-05-29 04:19:16
问题 Would you please help on how to export a chart to a image using google script. I wrote this code but it doesn't work. I'm worrying that the API getAs is deprecated. function TestEmailCharts(){ var sheet = SpreadsheetApp.getActiveSheet(); var charts = sheet.getCharts(); if(charts.length!=0) { var chartBlobs=new Array(charts.length); var emailBody="Charts<br>"; var emailImages={}; for(var i=0;i<charts.length;i++){ chartBlobs[i]= charts[i].getAs("image/jpeg").setName("chartBlob"+i); emailBody=

Spaces in Email

别说谁变了你拦得住时间么 提交于 2020-05-28 06:10:35
问题 I am trying to build a GSM Gmail addon that will open a card in the compose window and have several fields and then will generate a template and add it to the email. I have several variables containing HTML content and several containing fields from the card. I have almost gotten that done. The last thing that I need to do is to specify a subject, that will be the same every time, and specify recipients that will be based on a text field in the card. Here is my code. I have 2 files, one gs

Uploading binary files broken since yesterday, workaround?

谁说胖子不能爱 提交于 2020-05-28 02:29:48
问题 Update: I created an issue: https://issuetracker.google.com/issues/150675170 My web app worked well for a long time, but now suddenly the uploaded pdf files become corrupted. Below is a small reduced example that can be used to reproduce the issue. Looking at the uploaded file content, it looks like the file content is treated as text, and several characters are replaced with EF BF BD , which is the UTF-8 byte sequence for 'REPLACEMENT CHARACTER' (U+FFFD). For example, first bytes of the

Uploading binary files broken since yesterday, workaround?

你。 提交于 2020-05-28 02:28:55
问题 Update: I created an issue: https://issuetracker.google.com/issues/150675170 My web app worked well for a long time, but now suddenly the uploaded pdf files become corrupted. Below is a small reduced example that can be used to reproduce the issue. Looking at the uploaded file content, it looks like the file content is treated as text, and several characters are replaced with EF BF BD , which is the UTF-8 byte sequence for 'REPLACEMENT CHARACTER' (U+FFFD). For example, first bytes of the

Is it possible to perform a resumable upload using Drive.Files.update()

允我心安 提交于 2020-05-27 12:22:30
问题 I have two partially downloaded files (in my Drive), which I had split earlier. Both of these files together form the whole file. My goal is to merge (i.e join) them in Google Drive using Apps Script. What I have done so far? I used Drive.Files.insert to upload the first part. Then I tried Drive.Files.update to upload the second part to the first part's. It however overwrites the file. My question : Is it possible to join/append files using that method? NB: I could join the file in my PC with

How to avoid 'exec maxSimultaneous' limit in Google Spreadsheet?

时光总嘲笑我的痴心妄想 提交于 2020-05-27 06:52:06
问题 I'm using Google Spreadsheet for my tax administration. All financial transactions that I have done in a year are in the spreadsheet. Because the tax rules in my country are quite complex, I've developed a number of JavaScript functions to help me with my calculations. There are many rows in my spreadsheet, about 1000. Each row has multiple references to those JavaScript functions. This system worked beautifully before, but today I've found that Google installed some kind of runtime limiting