google-apps-script

Receive real time updates from a Google Spreadsheet

僤鯓⒐⒋嵵緔 提交于 2020-06-26 06:17:12
问题 I'm trying to setup a two-way sync with a Google Spreadsheet. I can push changes in my dataset to a Google Spreadsheet using its Google Sheets API V4 Now, I'd like to be able to get updates from the Google spreadsheet whenever someone make edits or adds new row in real-time or near-real-time. Any help that points me in the right direction is greatly appreciated. 回答1: You can do this manually by going to Tools-> Notification rules.. If the file is in Google Drive, you can try and make use of

Google Sheets script error “Unreachable Service: mirror”

大城市里の小女人 提交于 2020-06-26 05:55:11
问题 I have a script in Google Sheets where I literally can't execute anything. For example: function onOpen(e) { var ui = SpreadsheetApp.getUi(); // Or SpreadsheetApp or FormApp. ui.createMenu("Ampion Sheet Control") .addSeparator() .addItem("Ampion Sheet Control Wizard", "showSidebarIntro") .addToUi(); } I just get the error: Unreachable Service: mirror 回答1: To make sure the question has a noticeable answer: There is an issue submitted to the issue tracker that is as of now not yet resolved (or

Google Sheets script error “Unreachable Service: mirror”

本小妞迷上赌 提交于 2020-06-26 05:54:44
问题 I have a script in Google Sheets where I literally can't execute anything. For example: function onOpen(e) { var ui = SpreadsheetApp.getUi(); // Or SpreadsheetApp or FormApp. ui.createMenu("Ampion Sheet Control") .addSeparator() .addItem("Ampion Sheet Control Wizard", "showSidebarIntro") .addToUi(); } I just get the error: Unreachable Service: mirror 回答1: To make sure the question has a noticeable answer: There is an issue submitted to the issue tracker that is as of now not yet resolved (or

Save Google Slide as PDF using Google Apps Script

筅森魡賤 提交于 2020-06-26 05:03:51
问题 Is there a way to save a Google Slides as PDF file by using Google Apps Script? I could only find solutions for saving Google Docs and Sheets. 回答1: How about this sample script? When Google Docs (Spreadsheet, Document and Slide) is saved and/or downloaded using DriveApp.createFile() , the file format automatically becomes PDF. So we can use the following script. Sample script : var blob = DriveApp.getFileById("### Slide file ID ###").getBlob(); DriveApp.createFile(blob); Note : In this case,

Save Google Slide as PDF using Google Apps Script

♀尐吖头ヾ 提交于 2020-06-26 05:03:13
问题 Is there a way to save a Google Slides as PDF file by using Google Apps Script? I could only find solutions for saving Google Docs and Sheets. 回答1: How about this sample script? When Google Docs (Spreadsheet, Document and Slide) is saved and/or downloaded using DriveApp.createFile() , the file format automatically becomes PDF. So we can use the following script. Sample script : var blob = DriveApp.getFileById("### Slide file ID ###").getBlob(); DriveApp.createFile(blob); Note : In this case,

Cannot call FormApp.getUi() from bound Google Forms script

余生颓废 提交于 2020-06-25 21:50:10
问题 As the title says, I'm trying to get the UI of a Google Form from a script , so that I can show an alert box to the user with some information. This is the relevant part of the function: function Foobar(){ ... var ui = FormApp.getUi(); ui.alert("Foo", "bar", ui.ButtonSet.OK); } This code executes on the "On form submit" event trigger. Invariably, a few seconds later I get an email containing this error: Cannot call FormApp.getUi() from this context. Now, from my understanding, bound scripts

Google apps javascript doesn't run for anonymous users?

不问归期 提交于 2020-06-25 06:54:43
问题 This is probably a dumb newbie question, but I have a spreadsheet that I want to make available to anonymous users by just giving them the URL. After a lot of hair-pulling I now have the cell protection rain dance figured out, but I have another problem. The original sheet's onOpen works fine for me and creates a custom menu, but when I share the sheet and open it as an anonymous user, no menu appears. Fine, thought I, it isn't the first time Google's stuff doesn't work as advertised. So then

Generate google docs with QR code from google sheet

巧了我就是萌 提交于 2020-06-24 16:39:09
问题 I have a Google Sheet with many cells, one of which is a QR code (QR code contains name and Employee ID). A Google Docs file is generated based on the values from the worksheet, by replacing placeholder text. This Google Doc will be used as a digital pass. How can I place the QR code image in the Google Docs, generated from the Google Sheets data? Ex. In the sheet, I stored Employee ID , Name , and QR Code in columns A, B, and D. I use replaceText to replace placeholder text in the Document :

Generate google docs with QR code from google sheet

时间秒杀一切 提交于 2020-06-24 16:38:29
问题 I have a Google Sheet with many cells, one of which is a QR code (QR code contains name and Employee ID). A Google Docs file is generated based on the values from the worksheet, by replacing placeholder text. This Google Doc will be used as a digital pass. How can I place the QR code image in the Google Docs, generated from the Google Sheets data? Ex. In the sheet, I stored Employee ID , Name , and QR Code in columns A, B, and D. I use replaceText to replace placeholder text in the Document :

Is there a way to run two function at the same time in Google Apps Script with one function as an infinite loop?

可紊 提交于 2020-06-23 18:37:12
问题 I have two functions that I want to run at the same time but I can't just let them run separately as one function contains an infinite loop while(true) . And the problem with JavaScript is that if you where to run two functions, it will finish running the function before running the next one; so if I run a function with a while(true) loop, it will never move onto the next function. If you still don't understand, here is my code: function onOpen(){ // Google Apps Script trigger infLoop() //how