google-apps-script

How to set cell value from google sheet as default value of textarea for HTML sidebar?

这一生的挚爱 提交于 2021-02-11 16:46:50
问题 I have a standalone Google script using as library. This library contains HTML form using like sidebar with one <textarea> element and scripts. I want to get some value from a cell of active google spreadsheet to set it as default value of <textarea> element in the sidebar. And then update it with manually typing text and send it as new value to the source cell keeping sidebar is open. Library's scripts function showSidebar() { var html = HtmlService.createHtmlOutputFromFile('method.html')

How to set cell value from google sheet as default value of textarea for HTML sidebar?

落爺英雄遲暮 提交于 2021-02-11 16:46:47
问题 I have a standalone Google script using as library. This library contains HTML form using like sidebar with one <textarea> element and scripts. I want to get some value from a cell of active google spreadsheet to set it as default value of <textarea> element in the sidebar. And then update it with manually typing text and send it as new value to the source cell keeping sidebar is open. Library's scripts function showSidebar() { var html = HtmlService.createHtmlOutputFromFile('method.html')

Creating add ons in Google Apps Script

↘锁芯ラ 提交于 2021-02-11 16:40:18
问题 I have put together some code which I would like to access in other Google sheets, however, as it uses SpreadsheetApp.getUi the code has to be bound to a sheet. I have therefore decided to create the code as an add on. Unfortunately, the add ons don't appear in other spreadsheets and disappear from the spreadsheet where the add on was created unless I open up the apps script page. Where am I going wrong? var ui = SpreadsheetApp.getUi(); var ss = SpreadsheetApp.getActiveSpreadsheet(); function

A script to find a section of a formula in a group of cells and replace it with input from the user

醉酒当歌 提交于 2021-02-11 16:35:35
问题 I've put together an attendance google sheet that pulls data from weekly attendance tabs to a master sheet with all the weeks together. So far the master sheet is set so that more weeks can be added by pressing a button by duplicating the first week of the master sheet and appending it to the last column of the sheet. So what I need help with is in the cells of the new duplicated week find a portion of the formula, in the case would be the dates of the old week tab '9/21-9/25' (the full

A script to find a section of a formula in a group of cells and replace it with input from the user

人走茶凉 提交于 2021-02-11 16:31:50
问题 I've put together an attendance google sheet that pulls data from weekly attendance tabs to a master sheet with all the weeks together. So far the master sheet is set so that more weeks can be added by pressing a button by duplicating the first week of the master sheet and appending it to the last column of the sheet. So what I need help with is in the cells of the new duplicated week find a portion of the formula, in the case would be the dates of the old week tab '9/21-9/25' (the full

A script to find a section of a formula in a group of cells and replace it with input from the user

女生的网名这么多〃 提交于 2021-02-11 16:31:09
问题 I've put together an attendance google sheet that pulls data from weekly attendance tabs to a master sheet with all the weeks together. So far the master sheet is set so that more weeks can be added by pressing a button by duplicating the first week of the master sheet and appending it to the last column of the sheet. So what I need help with is in the cells of the new duplicated week find a portion of the formula, in the case would be the dates of the old week tab '9/21-9/25' (the full

A script to find a section of a formula in a group of cells and replace it with input from the user

假如想象 提交于 2021-02-11 16:30:57
问题 I've put together an attendance google sheet that pulls data from weekly attendance tabs to a master sheet with all the weeks together. So far the master sheet is set so that more weeks can be added by pressing a button by duplicating the first week of the master sheet and appending it to the last column of the sheet. So what I need help with is in the cells of the new duplicated week find a portion of the formula, in the case would be the dates of the old week tab '9/21-9/25' (the full

Button change text display every after click

末鹿安然 提交于 2021-02-11 15:57:43
问题 I am new in Google script. Could you please help me on this. I want to create a button in googlesheet with series of text display every after click. ( I dont know what to put in script) OPEN (green background) --> CLICK--> CLOSE ( red background) --> CLICK--> OPEN (green background)...and so on Thank you in advance 回答1: I believe your goal as follows. You want to achieve the button which is changed when the button is clicked on the Google Spreadsheet. For example, when the button with the

Change file name of file uploaded using Google Drive API - Apps Script

纵饮孤独 提交于 2021-02-11 15:51:57
问题 I created a script that can upload files on Google Drive Shared Drives using service account. However, I having trouble on renaming the file. I always get "Untitled" file name. This is my code: function movefiletoDrive(fileId, driveID, parentDriveId){ var body = {"title":"RJ"} var service = getDriveService(); service.reset() if (service.hasAccess()) { var url = 'https://www.googleapis.com/drive/v3/files/'+fileId+'?addParents='+driveID+'&removeParents='+parentDriveId+'&supportsTeamDrives=true'

How to send several rows of google sheet table via email if cell match today's date

本秂侑毒 提交于 2021-02-11 15:47:22
问题 daily I have to send different qty of google sheet table rows (it depends on how many trucks were departed) via e-mail to a few recipients. Could you help me, please, with an example of how to collect several rows of google table if cell match today's date and then send it via email? For example, I need to grab all rows with today's date and send data from columns A, B, C, E via e-mail. Thanks for any help in advance :) 回答1: Let's go step by step. I'm supposing the column A contains the dates