google-apps-script

How to create a shortcut in Google Drive Apps Script instead of multiple parents

二次信任 提交于 2020-12-26 09:00:38
问题 I've been trying to read about it here: https://developers.google.com/drive/api/v3/shortcuts And I understand the basics in shortcuts but I can't figure out how to use it in the code - the syntax. I need to instead of placing a folder in multiple folders, placing shortcuts in those folders named the same as the original folder. I have an original folder called Project1 placed in Drafts. Shortcuts for this folder needs to be places in Folder2/Drafts, Folder3/Drafts and Folder4/Drafts. If I

google.script.run.withSuccessHandler don't return value

泪湿孤枕 提交于 2020-12-26 08:31:59
问题 it is getting me crazy, the code was working yesterday, but not anymore. I tried to check all syntax again, but the issue still persists. this server-side request from google sheets, shows value on server side ( Logger.log() ), but returns null in client side! Can you help me to find the issue, please! function supervisorLine(lineData){ if (lineData== 'Name Value is not VALID!' ) { console.log("Supervisor Name Issue!"); } else { document.getElementById('Team').value= lineData[7]; document

google.script.run.withSuccessHandler don't return value

蹲街弑〆低调 提交于 2020-12-26 08:28:18
问题 it is getting me crazy, the code was working yesterday, but not anymore. I tried to check all syntax again, but the issue still persists. this server-side request from google sheets, shows value on server side ( Logger.log() ), but returns null in client side! Can you help me to find the issue, please! function supervisorLine(lineData){ if (lineData== 'Name Value is not VALID!' ) { console.log("Supervisor Name Issue!"); } else { document.getElementById('Team').value= lineData[7]; document

Google Apps Script findtext searchpattern format?

二次信任 提交于 2020-12-26 07:44:28
问题 I am trying to pass in simple regex strings like findText("/a/"); or findText(/a/); but it does not find anything. If I pass in only the text that works like this findText("a"); How to pass regex strings in there? 回答1: Use the String.search() method. function test(){ var testString = "1212a1212"; var results = testString.search(/a/); Logger.log(results); //results = 4; } 回答2: It's not super clear in the documentation of findText, but the documentation for replaceText is more clear: The search

Looping through multiple google spreadsheets with google scripts

爷,独闯天下 提交于 2020-12-26 04:37:18
问题 So I have multiple different spreadsheets inside of google drive (completely different files, not in the same file and different sheets), and I've been trying to figure out a way to pull data from all of the spreadsheets and populate one main sheet. But the problem I've been trying to figure out is that I can't seem to find a way to loop through all the spreadsheets. I've read a suggestion on another similar question in which they said to create a different spreadsheet that stored all the

Looping through multiple google spreadsheets with google scripts

旧城冷巷雨未停 提交于 2020-12-26 04:35:20
问题 So I have multiple different spreadsheets inside of google drive (completely different files, not in the same file and different sheets), and I've been trying to figure out a way to pull data from all of the spreadsheets and populate one main sheet. But the problem I've been trying to figure out is that I can't seem to find a way to loop through all the spreadsheets. I've read a suggestion on another similar question in which they said to create a different spreadsheet that stored all the

Looping through multiple google spreadsheets with google scripts

烈酒焚心 提交于 2020-12-26 04:32:35
问题 So I have multiple different spreadsheets inside of google drive (completely different files, not in the same file and different sheets), and I've been trying to figure out a way to pull data from all of the spreadsheets and populate one main sheet. But the problem I've been trying to figure out is that I can't seem to find a way to loop through all the spreadsheets. I've read a suggestion on another similar question in which they said to create a different spreadsheet that stored all the

When passing variable to function I get 'Invalid argument', but when I hard code it works in Apps Script

心不动则不痛 提交于 2020-12-23 08:21:11
问题 This is my test function: var testFolderId = 'di98kjsdf9...'; function testGetFolder(testFolderId){ folder = DriveApp.getFolderById(testFolderId); Logger.log("folders: " + folder); } It fails when I do this. The error says: INVALID ARGUMENT However, if I hardcode the id into the 'DriveApp.getFolderById' function, it works. Any explanation? This makes no sense to me. 回答1: When a function is called directly from the script editor/menu/button click/triggers, the following sequence of actions

Can I use in Google Apps Scripts a defined Class in a library with ES6 (V8)?

别等时光非礼了梦想. 提交于 2020-12-23 02:39:28
问题 I'm trying to use a class defined in a library but I only receive an error as a result. [LibraryProject]/library/model/Update.gs class Update { constructor(obj = {}) { if(typeof obj == "string"){ options = JSON.parse(obj); } Object.assign(this, obj); } text(){ return (this.message && this.message.text)?this.message.text:'' } } TASKS ✅ Create a new version of the project. (File > Manage versions...) ✅ Load this library in another project [Alias: CustomService] (Resources > Libraries...) ✅ Use

Function similar to vlookup: Why doesn't my indexOf work?

做~自己de王妃 提交于 2020-12-21 04:15:49
问题 If I would like to match the word that I need to find it the same as <lookup> in Excel. I intend to create a form for Example. I have a file certain big data and I will create a box for fill in data that you need then Enter it show the Description of data. Now I got stuck I don't know how to write to the script I have learned in youtube but don't have a solution that nearby with my need it nearby just <Indexof> function. var data = Activesheet.getRange(1,1,Activesheet.getLastRow()-1,1)