google-apps-script

Parse values from HTML element using Google App Script?

天大地大妈咪最大 提交于 2021-02-08 06:14:17
问题 I am trying to parse HTML element by class on Google Sites, my code is: function doGet(){ var html = UrlFetchApp.fetch ('http://indicadoresdeldia.cl/').getContentText(); var doc = XmlService.parse(html); var html = doc.getRootElement(); var menu = getElementsByClassName(html, 'span3 utm')[0]; var output = XmlService.getRawFormat().format(menu); return HtmlService.createHtmlOutput(output); } Ween i run the code appear the nexte error message ReferenceError: "getElementsByClassName" is not

Are Google Apps Script Library quotas measured against the owner or active user?

怎甘沉沦 提交于 2021-02-08 06:13:45
问题 If you publish a Google Apps Script Library are the script quotas applied per library owner or for the library user? 回答1: Libraries are not web services. It goes exactly like when you are using client side lib like Jquery. When you are using an Apps Script lib, you just add extra code to the one in your code editor. So quota is measured against the lib user. Otherwise it would be impossible to have libs used by many many users :) Best, Romain 来源: https://stackoverflow.com/questions/25733831

How to Hide Images in Google Spreadsheets with Google Apps Script?

若如初见. 提交于 2021-02-08 05:41:43
问题 I'm building a dashboard in Google Spreadsheets and want to include some images to be shown when certain rows are hidden/shown. Is this possible? I've used insertImage to insert the image but I can't find a way to delete or hide the image (hiding the rows does not affect images). Any ideas? 回答1: There is no straightforward way of removing an image from the Apps Script API. Even if you delete a row, the image will still remain. You should raise a request for this feature in the Issue Tracker (

Google Script Export Spreadsheet to XML File

假装没事ソ 提交于 2021-02-08 05:34:51
问题 I am trying to create a menu button in my Google Spreadsheet that runs a script. This script should extract specific rows and columns, then export them to an XML file. I am trying to write the xml file using the ContentService, but it does not seem to work. Is there an example or tutorial that can help? Thanks 回答1: Are you getting any error messages? Or, what specifically is not working? I've just tested it and it seems fine, here's my snippet function doGet(e) { var content; try { content =

Accessing comments in Google Documents

若如初见. 提交于 2021-02-08 05:28:59
问题 I am being unable to figure out how to access comments in Google documents using Google Apps Scripts. Looking at the API reference, I found only the CommentSection class, but that is marked deprecated. Looking for some help. Thanks. Sanjay 回答1: Unfortunately it's not currently possible to access the document's comments using Google Apps Script. You can file a feature request for this on the issue tracker. 回答2: Following the initial discussion in this post I've managed to get the comments in a

Dynamically Bind Data source to app maker popup

江枫思渺然 提交于 2021-02-08 05:07:20
问题 I need to have a generic "Delete confirmation" pop up and dynamically bind data source to the pop up using event fired before pop-up is appeared. Popup will be appeared on clicking the delete icon on "Location" Page (screenshot bellow). I need to set the data source of the popup at the same time. (when user click on this delete icon) and record has to be deleted when user click on "Delete" button on the popup. This is the code I have currently for the onclick event of the delete icon above

How Do I create an Installable Trigger on a specific Deployment from Standalone Script With Event Source Spreadsheet?

Deadly 提交于 2021-02-08 05:05:09
问题 Background: I have been learning Google Apps script, and now have a working standalone Google Apps Script project, just for personal use, in which I have created an Installable Trigger that is configured with Event Source: "From Spreadsheet", creating it programmatically (I was unable to find a way to create this trigger through the web interface (Edit menu --> Current project's triggers) since the event source drop-down only shows "timed" and "From Calendar" as selections). A few weeks back

Google Apps Script in Google Sheet - Convert formulas to static values - cell function to value

假装没事ソ 提交于 2021-02-08 04:44:23
问题 Is there a Google Apps Script method that will change a cell with a formula to one with a static value? The reason for this is to avoid lag in the Sheet from lots of cell formulas recalculating as the sheet becomes larger. I want to make the sheet replace old formulas with static values since they won't be changing. 回答1: Use the copyValuesToRange() method: function copyFormulasToValues() { var ss = SpreadsheetApp.getActiveSpreadsheet(); var sourceSheet = ss.getSheetByName("Sheet1"); var

Increase my script performance Google Sheets Script

只愿长相守 提交于 2021-02-08 03:14:59
问题 I created a function that whenever I run the AppendRow script every row that does not have a dot (".") at the AY column, an array with every information/column that I want from that sheet will be transfered to my main sheet that has around 13k rows atm. Usually about 20-40 rows get pasted into the first sheet everyday and this script automatically re-arranges the columns to my main sheet. PROBLEM: The problem is that each row that gets appended to my main sheet takes around 8-15sec to get

Increase my script performance Google Sheets Script

吃可爱长大的小学妹 提交于 2021-02-08 03:10:14
问题 I created a function that whenever I run the AppendRow script every row that does not have a dot (".") at the AY column, an array with every information/column that I want from that sheet will be transfered to my main sheet that has around 13k rows atm. Usually about 20-40 rows get pasted into the first sheet everyday and this script automatically re-arranges the columns to my main sheet. PROBLEM: The problem is that each row that gets appended to my main sheet takes around 8-15sec to get