google-apps-script

Can NOT authorize calling Script for new ScriptDb when Included Library remains from previously deleted ScriptDb.

寵の児 提交于 2021-01-28 05:53:47
问题 I deleted a ScriptDb BEFORE I removed its reference from the Resources -> Installed Libraries of the calling script. I created a new ScriptDb with the same name as the old ScriptDb. When I run the calling script, I get the following message: Library with identifier libraryDb is missing (perhaps it was deleted?) When I open Resources -> Installed Libraries in the calling script, I get the following message: We're sorry, a server error occurred. Please wait a bit and try again. And when I click

Grabbing multiple attachments with a specific file name in Google Appscript

荒凉一梦 提交于 2021-01-28 05:50:47
问题 needing help with adding 'n' number of attachments. Code below: for(var i = 2; i<=lr; i++) { var Contact_Person = ss.getRange(i,4).getValue(); var PDFs = ss.getRange(i,6).getValue(); //The above i am grabbing the PDF name from a column in my sheet. //This name is used for generating my Mail Merge File. var contents = DriveApp.getFolderById('1ouiQE2cERaRMC_rnSftJCqQCpr2B4x3D').getFiles(); PDFs = DriveApp.getFilesByName(Contractor_Name); if(PDFs.hasNext()) { var attach = []; while(contents

Google Sheets IMPORTHTML

ⅰ亾dé卋堺 提交于 2021-01-28 05:48:32
问题 I have completed the following script. I want to get a table in my Google Sheet with IMPORTHTML, everything works fine, only if the data changes, then that doesn't change in the Google table. I run the whole thing with a trigger so that will be updated every minute. But here comes the problem, if I let the whole thing run like this and the data changes on the website, and here comes now the problem that doesn't change in the Google Sheet, the old values ​​are simply taken over and over again

Stop a custom function from recalculating every time the spreadsheet is open?

让人想犯罪 __ 提交于 2021-01-28 05:35:27
问题 I have a custom function that uses fetch to save some information to a spreadsheet. The problem is, it's meant to be used many times on the spreadsheet, fetching from various pages. As the amount of uses increases, needlessly re-fetching information every time the spreadsheet opens will become more and more of a problem. Is there any way to avoid this default behavior? I still want it to recalculate every time the cell is edited, even if the parameters are exactly the same. Is there perhaps a

google.script.run fails in case of file input

回眸只為那壹抹淺笑 提交于 2021-01-28 05:32:37
问题 I have a google apps script bounded to a spreadsheet, and I created a html form to upload csv and excel files to process them and load the data to the spreadsheet. Everything worked fine in the last 2 years, but since March 2020 the file uploading fails. When I submit the upload form, I got the following message: We're sorry, a server error occurred. Please wait a bit and try again. I checked and the the server-side function is not even called. If I remove the file input field from the form,

Only get non-filtered values for Google App Script getRange

坚强是说给别人听的谎言 提交于 2021-01-28 05:32:29
问题 Is there a way to only get non-filtered values only in Google App Script? (i.e. get values that are showing and not hidden ones? For example, let’s say I have the following cells + values in Google Sheets. A1=abc B1=x A2=def B2=y A3=ghi B3=y A4=kjl B4=x And I filtered B column so it only displays [y]. A2=def B2=y A2=ghi B3=y When I use the following script, both hidden and non-hidden values gets printed to the msgBox. function msgBoxTest(){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var

Implementation of GoogleSheets Stock Price Email Alerts

若如初见. 提交于 2021-01-28 05:20:45
问题 I have a Googlesheets Stock Price Alert Script Running for a single stock in a GoogleSheet. It checks the current price against a target price and sends an email alert if it is lower. How would I expand my script to check a list of stocks in the spreadsheet? I think I need a loop or something to scroll down each row but I'm unsure of how to do this. My working code for single row check: // Fetch the stock price var stockNameRange = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1"

G Suite Marketplace Add-on OAuth: Error 400: invalid_request Account restricted

泄露秘密 提交于 2021-01-28 05:13:31
问题 Has any Google Add-on developers received this error when a user trys to install: Error 400: invalid_request Account Restricted This only happens to some users even if the app is whitelisted in the domain admin console of the user. Our app is listed on the G Suite Marketplace and is approved and verified, the OAuth consent screen works for most users. The user is able to see the consent screen but as soon as they click Accept they get this error: 回答1: I had the same issue with one of my G

Increment ID from last row google apps script

元气小坏坏 提交于 2021-01-28 05:10:03
问题 I coded something for google apps script. It is to increment ID +1 based on the last row. Everything is working so far except for the numbering of the new ID, instead of appearing as a number. The result appears as R-NaN instead of R-002 or something similar What do you think should I revise in my code? Thank you. function new_item() { // Get current spreadsheet var app = SpreadsheetApp; var ss = app.getActiveSpreadsheet(); var mysheet = ss.getActiveSheet(); // Set date to today in update

How can I use Google Apps Script to move files between personal Google Drives and Team Drives?

主宰稳场 提交于 2021-01-28 05:07:05
问题 Recently, I gained access to Google Team Drive via Google's Team Drive early adopter program. I created a Google Docs file called Hello, world! , and then wrote a short Google Apps Script function which uses an addFile() method to update which Google Drive folder the file is attached to: function move_or_link_file() { var source = DriveApp.getFolderById("<sourceID>"); var fileiter = source.getFilesByName("Hello, world!"); var dest = DriveApp.getFolderById("<destID>"); while (fileiter.hasNext(