google-apps-script

Apps Script Addon: How to track admin domain install?

亡梦爱人 提交于 2021-01-28 14:39:48
问题 I'm trying to get the list of emails of users who installed my addon. I'm using the onInstall trigger to get the email and push it to my database. This is fine with individual installation (normal gmail or even admin who chooses to Individual Install) But with Domain Install , onInstall event was not fired So how can I track the Domain Installation? 回答1: We can use the LicenseNotification endpoint of the G Suite Marketplace API: https://developers.google.com/gsuite/marketplace/v2/reference

How to retrieve JSON specific content from Google Drive with Google Apps Script?

元气小坏坏 提交于 2021-01-28 14:38:00
问题 I have the following folder tree: base ├── aaa │ ├── aaa 111 │ ├── aaa 222 │ └── aaa 333 ├── bbb │ ├── bbb 111 │ ├── bbb 222 │ └── bbb 333 │ ├── yyy 111 │ ├── yyy 222 │ └── yyy 333 └── ccc ├── ccc 111 ├── ccc 222 └── ccc 333 The JSON file document.json.txt for the tree above, which is uploaded to my Google Drive, is like so: [ {"type":"directory","name":"BASE","contents":[ {"type":"directory","name":"AAA","contents":[ {"type":"directory","name":"aaa 111","contents":[ ]}, {"type":"directory",

How to identify changed cell in onChange function

ぐ巨炮叔叔 提交于 2021-01-28 14:23:06
问题 I am trying to detect background color change of two cells. A while back I created the following Google Sheet function and added it as an installable trigger From spreadsheet On change since cell color changes are not detected by on Edit. I thought it worked but I just checked it now, and it is not detecting which cell's background color was changed, Any ideas? function onChangeInstallable(e) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var activeSheet = ss.getActiveSheet(); var

How to identify changed cell in onChange function

做~自己de王妃 提交于 2021-01-28 14:18:29
问题 I am trying to detect background color change of two cells. A while back I created the following Google Sheet function and added it as an installable trigger From spreadsheet On change since cell color changes are not detected by on Edit. I thought it worked but I just checked it now, and it is not detecting which cell's background color was changed, Any ideas? function onChangeInstallable(e) { var ss = SpreadsheetApp.getActiveSpreadsheet(); var activeSheet = ss.getActiveSheet(); var

Google Apps Script: Workflow approval Selecting approval broken

拈花ヽ惹草 提交于 2021-01-28 14:01:07
问题 I'm working to expand on the workflow script posted here... James Ferreira Workflow video. I've expanded the script and all is working fine regarding email, but I'm running into an issue with the doGet() function not working corretly. Here is the code from the video: (mycode for the sendEmail is different and works fine, as it uses and document template. function sendEmail(e) { var email = e.values[1]; var Item = e.values[2]; var cost = e.values[3]; var url = '<ENTER YOUR PUBLISHED URL>'; var

Google Apps Script: Workflow approval Selecting approval broken

那年仲夏 提交于 2021-01-28 14:01:02
问题 I'm working to expand on the workflow script posted here... James Ferreira Workflow video. I've expanded the script and all is working fine regarding email, but I'm running into an issue with the doGet() function not working corretly. Here is the code from the video: (mycode for the sendEmail is different and works fine, as it uses and document template. function sendEmail(e) { var email = e.values[1]; var Item = e.values[2]; var cost = e.values[3]; var url = '<ENTER YOUR PUBLISHED URL>'; var

Google Script: Append new values in column to another sheet

核能气质少年 提交于 2021-01-28 13:34:44
问题 I have been working on this project and can't get it to work quite the way I want. I have two sheets with unique IDs in one column. I need to make sure whenever a new ID is added in one sheet (Sheet1), it is copied to the last empty row in the other sheet (Sheet2). Making sure it ignores it if the value already exist (to avoid duplicates). The idea was to create a function and have it triggered every minute or so. Below is the example spreadsheet and the script that is almost working now. The

Google Script: Append new values in column to another sheet

纵饮孤独 提交于 2021-01-28 13:31:32
问题 I have been working on this project and can't get it to work quite the way I want. I have two sheets with unique IDs in one column. I need to make sure whenever a new ID is added in one sheet (Sheet1), it is copied to the last empty row in the other sheet (Sheet2). Making sure it ignores it if the value already exist (to avoid duplicates). The idea was to create a function and have it triggered every minute or so. Below is the example spreadsheet and the script that is almost working now. The

Create a dependent dropdown for multiple tabs and multiple rows

点点圈 提交于 2021-01-28 12:45:29
问题 //CREATE PRIMARY DROPDOWN LIST function createPrimaryDrpdwon() { /* SET FOLLOWING VARIABLES */ var dataSS = "Lookup"; //Name of the sheet that contain data for dropdown lists var dropSS = "Jun 15"; //Name of the sheet which dropdown list to be created var primaryDataRange = "A4:A14"; //Data range for primary dropdown var primaryDropRange = "H3:H200"; //Range which primary dropdown set var primaryDropList = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(dataSS).getRange(primaryDataRange)

Create a dependent dropdown for multiple tabs and multiple rows

耗尽温柔 提交于 2021-01-28 12:44:40
问题 //CREATE PRIMARY DROPDOWN LIST function createPrimaryDrpdwon() { /* SET FOLLOWING VARIABLES */ var dataSS = "Lookup"; //Name of the sheet that contain data for dropdown lists var dropSS = "Jun 15"; //Name of the sheet which dropdown list to be created var primaryDataRange = "A4:A14"; //Data range for primary dropdown var primaryDropRange = "H3:H200"; //Range which primary dropdown set var primaryDropList = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(dataSS).getRange(primaryDataRange)