google-apps-script

Load sidebar onOpen google Sheets

别说谁变了你拦得住时间么 提交于 2020-06-29 13:36:21
问题 I am trying to load the sidebar when the page opens. I have important information that i was readily available for them to see. How can i load the sidebar when page is opened? I also could do onEdit if need be. function onOpen(){ var ui = SpreadsheetApp.getUi() .createAddonMenu() .addItem('Show sidebar', 'showSidebar') .addItem('Show dialog', 'showDialog') .addSeparator() .addToUi(); // Display sidebar if auto-sidebar is enabled showSidebar(); SpreadsheetApp.getUi().createMenu('Information')

How to login into the Fidelity website and navigate within it?

旧时模样 提交于 2020-06-29 08:31:41
问题 I would love to get some help in logging into the Fidelity website and navigate within it. My attempts so far have not led me to anywhere significant. So here is the code that I have written, after much consultation with answers around the web. The steps are: Login to Fidelity Check if response code not 200, but is 302 or 303 and my code passes this test (with a code of 302). Then I check the number of cookies returned (there were 5) and for each cookie I try to navigate to a different web

Why is my Apps Script deletion loop running so slowly? Can I improve performance?

回眸只為那壹抹淺笑 提交于 2020-06-29 08:15:08
问题 My company collects manufacturing data a few dozen times a day through Google Form responses. Right now the Sheet I'll be referencing is near 10,000 rows. Recently I frankensteined some Google Apps Script code (from other SO threads and forums) to delete rows from a large spreadsheet that are older than 7 days. During trials (on a copy of the Sheet) the script deleted 3-4 rows per second. Now, the code is deleting only one row every 7-8 seconds. I don't know why my code is running so slowly.

Stackdriver Logging API returns response code 200, but response is empty

依然范特西╮ 提交于 2020-06-29 06:56:57
问题 I'm trying to fetch stackdriver logs via Stackdriver Logging API v2. I do this by making a POST request from google apps script project, in particular using UrlFetchApp. The thing is, it runs successfully, but the response shown in log is empty. However, when I made the same request using apirequest.io, curl and Google API explorer, I got the necessary response. I searched extensively, but to no avail. Tried experimenting with header, url, but nothing. function exportLogs () { var options = {

G Suite Add-on refusing to connect to drive? How to solve “drive.google.com refused to connect” error?

走远了吗. 提交于 2020-06-29 05:47:06
问题 I am trying to use a G Suite Add-on called YAMM that I regularly use. Recently, I have been encountering an error "drive.google.com refused to connect" often. When I contacted the developer, they say it is Google's problem. How do I get it fixed? 回答1: This happens if you have signed in with multiple gmail accounts in your web browser. To solve this problem as an end user, open an incognito window, sign in with your gmail account used to install the add-on and use the addon - https:/

G Suite Add-on refusing to connect to drive? How to solve “drive.google.com refused to connect” error?

橙三吉。 提交于 2020-06-29 05:46:10
问题 I am trying to use a G Suite Add-on called YAMM that I regularly use. Recently, I have been encountering an error "drive.google.com refused to connect" often. When I contacted the developer, they say it is Google's problem. How do I get it fixed? 回答1: This happens if you have signed in with multiple gmail accounts in your web browser. To solve this problem as an end user, open an incognito window, sign in with your gmail account used to install the add-on and use the addon - https:/

Exporting Google sheet as .XLXS and renaming

家住魔仙堡 提交于 2020-06-29 05:44:28
问题 I have found a script to export my google sheets workbook as .XLXS and email it to an address. However it is not working when i try and set the name of the .xlxs file to a value in the workbook. code below: function getGoogleSpreadsheetAsExcel(){ try { var ss = SpreadsheetApp.getActive(); var name = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Project Details').getRange(2,A).getValue() var url = "https://docs.google.com/feeds/download/spreadsheets/Export?key=" + ss.getId() + "

How to use Google Apps Script to get POST request from Stripe webhooks

有些话、适合烂在心里 提交于 2020-06-29 05:23:08
问题 I am trying to get POST request from Stripe webhooks into Google sheet, in order process sales data in Google apps environment. I set up a web app by Google Apps Script, and try to test the webhook using testing function of Stripe. I chose "invoice.payment_succeeded" as the event type to test. My code is as follow: function doPost(e) { var jsonString = e.postData.getDataAsString(); var event = JSON.parse(jsonString) var ss = SpreadsheetApp.openById("XXX"); var sheet = ss.getSheetByName("XXX")

Google Apps Script Calendar Service: How to avoid exceeding maximum execution time?

↘锁芯ラ 提交于 2020-06-29 05:14:05
问题 I need to edit a few hundred or even a few thousand calendar events through Google Apps Script. It is about just minor changes to title ( event.setTitle() ) and description ( event.setDescription() ), nothing fancy. Trying with about 600 events the maximum execution time of 360 seconds is already exceeded. var cal = CalendarApp.getCalendarById("Calendar Id"); var startTime = new Date(1850, 0, 1); var endTime = new Date(2100, 0, 1); var events = cal.getEvents(startTime, endTime); for (var i =

How to check if current form submission is editing response

此生再无相见时 提交于 2020-06-29 05:06:15
问题 I need to return the row number of a Google Form submission that has been resubmited. I followed all of the information at: Google Forms App Script : How to check if current submission is editing response or a new response, but I get this error for trigger formSubmit: Exception: Cannot convert '15.0' to int. So it is correctly finding the 15th row as edited and appears to be giving me a number, but i keep getting the error when i try to use that number. I've tried to convert it using +num ,