google-apps-script

copyTo(destination, copyPasteType, transposed) stops rest of function from executing

社会主义新天地 提交于 2021-01-29 10:35:16
问题 I'm trying to use the function copyTo(destination, copyPasteType, transposed) to copy a sheet in one file to another sheet in a different file while keeping everything, including column width, the same. Using just the function copyTo(destination) , my code works and I get everything I want in a different file, EXCEPT the column width. However, when I try and use copyTo with the copyPasteType argument, the sheet is copied perfectly (with the correct column widths), BUT any subsequent code isn

Sending only one sheet or active sheet as pdf via email

孤者浪人 提交于 2021-01-29 10:31:06
问题 Hello I have been trying to write my first script to send just one of the sheet from one of my google document but everytime I end up sending all the sheets instead. The document has a main page daily where i have the list of emails and then 7 sheets called monday, tuesday, etc This is the code i use - can you help? function emailActivesheetAsPDF() { DocumentApp.getActiveDocument(); DriveApp.getFiles(); const ss = SpreadsheetApp.openByUrl("https://docs.google.com/spreadsheets/d/1

Using Google Scripts to Query Multiple Google Sheets to A View

为君一笑 提交于 2021-01-29 10:25:42
问题 I have a Google Spreadsheet that stores employee availability information for my workplace. Every Sheet has the format shown in the example below, with the date fields changing based on the week for which I am collecting availability. Employees submit availability every week by submitting a Google Form that is linked to these Sheets on the backend. My workplace leadership has directed that I limit each Sheet to contain at most one week of data. 09 Jul - 13 Jul Responses Timestamp | Email

How to set correct answer text in google forms from spreadsheet using script

久未见 提交于 2021-01-29 10:23:45
问题 I want to make auto-grading short-answer quiz using google forms. The data is in spreadsheet. column A has questions. column B has correct answers. column C has explanations. The code below makes quiz, but don't set correct answer in each question. "item.createResponse(an);" seems not working. How do I set correct answer? let form = FormApp.openById(formID); form.setIsQuiz(true); // get data from sheet let ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('문제'); let range = ss

Can I use Slides API to add an “Agree to Terms” dialogue before allowing viewer access to a Slides presentation?

浪子不回头ぞ 提交于 2021-01-29 10:16:23
问题 I have a Google Slides presentation that I'd like to gate with a request to agree to "Terms & Conditions" before viewing. (The dialogue box would include an external link to the legal fine print.) I see that with Google App Script adding a dialogue box is possible, but if one can be customized in this manner is unclear to me. Thanks in advance for any help on this. 回答1: You want to open a dialog, when users open the Google Slides. In this case, users are logged in to each Google account. You

How to modify current insert timestamp script to remove timestamp when cell is cleared

瘦欲@ 提交于 2021-01-29 10:00:35
问题 I am currently using the following script to add a timestamp to a cell in Column H when cell in Column A is populated. Problem is, when I delete the contents of Column A the timestamp remains in Column H. I currently have conditional formatting to hide the timestamp if the cell is empty but I really need the contents to be deleted. How do I modify my current script to accomplish this? function onEdit(event) { var sheet = SpreadsheetApp.getActiveSheet(); if(sheet.getName() == "CHECK OUT" ||

How to copy image from one table cell to another within google documents using a google script (programmatically)?

痞子三分冷 提交于 2021-01-29 09:49:53
问题 I would like to copy the content of one google doc to another. The content includes text, tables and images. My code copies the text and the tables. However, whatever is contained in table cells is not copied. I made a simplified version of the code and single document accessible here: https://docs.google.com/document/d/1hcQzBuMA6E15u8VtW2lWGL7XCcU3qVsDhn-5jiznQP4/edit?usp=sharing. The code simply copy-pastes the content of the google document which includes a table containing a table/images.

Getting Boolean Values from Checkboxes and Appending them as Numbers in another sheet, like Database

a 夏天 提交于 2021-01-29 09:46:46
问题 Hi Google Apps Script Programmers, Picture making a kind of database for a sandwich shop in Google Sheets, where most sheets are data tables with column 1 being an autonumber field. The first sheet is the main order form named MySubShop. It'll record the order#, cashier, customer, date/time, and have a bunch of checkboxes for the foods. The second sheet is named Lookups and has lookups for bread types and beverage types only because people can only select 1 type of bread and 1 beverage. The

Google App Script to copy rows into dynamically created tabs based on the value of a column

时间秒杀一切 提交于 2021-01-29 09:45:49
问题 First - I'm a teacher and self-teaching myself apps script, so please forgive my sloppy code. The results of my district's frequent standardized tests are often delivered with all the tests combined into one sheet. They would be much easier to manage if each test were in their own sheets. I modified a function that I found on this site to create one new tab for each unique value in the test column (M). That takes care of having tabs to copy the rows into. It uses an array and I honestly don't

Google Apps Script PropertiesService - Confused by unreliable Executions logging & editor debugging

假如想象 提交于 2021-01-29 09:34:18
问题 I find PropertiesService to be unreliable, but probably I'm just not familiar with Google Apps Script or Stackdriver and made a mistake or assumed something here that may caused the problem. Here's the script: sp = PropertiesService.getScriptProperties() sp.setProperties({ 'somekey': 'value' }) props = sp.getProperties() console.log(props.toString()) And here's the logs before I wrote this SO question: Type Start Time Duration Status Stackdriver Log Trigger Oct 9, 2020, 11:19:07 PM 0.541 s