google-apps-script

Copying Sheet Data to Doc table

耗尽温柔 提交于 2021-01-29 08:05:59
问题 I have a sheet with information that needs to be filled and once a submit process is started it should copy the cell data to an existing table header in a document. There is only one table in the document with the header info. I can get this to work just fine with appendTable, but I would like to append rows to the existing table in the document. Data from spreadsheet looks like [[1234, Jordan, Connecticut], [6899123, Job Site, Connecticut], [, , ]] // Sheet Data var ss = SpreadsheetApp

Google Apps Script - Fetch data from third party API with date parameter

让人想犯罪 __ 提交于 2021-01-29 08:05:14
问题 One of my vendors has created an API that I can use to pull data. I'm trying to use google apps script for this as I can easily schedule the data pull on it. I've used the UrlFetchApp before but I'm lost with this as I have to pass an additional parameter in it for a date - I don't know how to do this and I would appreciate your help figuring this out. The instructions given to me are these: url = "https://xxxxx.com/api/leads/" method = POST //Request JSON format: (date format should be ‘Y-m

Range#sort fails to sort based on new formula's values

孤人 提交于 2021-01-29 08:04:24
问题 I am extracting data from several Google Sheets into one main sheet using Google Apps Script. To convert dates to week-numbers I use the sheet function ISOWEEKNUM() for column 1. I want to sort by week-numbers and because of headers I use Range#sort. The problem I am having is that no sorting is performed when I test run getData() , the Range#sort call has no effect. If I first run getData() and then manually run my sortRange() function it works. Is there something about writing cells with

Range#sort fails to sort based on new formula's values

谁都会走 提交于 2021-01-29 07:59:39
问题 I am extracting data from several Google Sheets into one main sheet using Google Apps Script. To convert dates to week-numbers I use the sheet function ISOWEEKNUM() for column 1. I want to sort by week-numbers and because of headers I use Range#sort. The problem I am having is that no sorting is performed when I test run getData() , the Range#sort call has no effect. If I first run getData() and then manually run my sortRange() function it works. Is there something about writing cells with

How to use Google Apps Script to set the “values” and “go to section based on answer” for a Google Form dropdown?

限于喜欢 提交于 2021-01-29 07:57:33
问题 I using Google Sheets to store the "values" and "go to section based on answer" for a Google Form dropdown. How can I use the Google Apps Script to set both "values" and "go to section based on answer" for the dropdown? I am able to set values from Google Sheet using the script, but I am not able to set the "go to section based on answer" for the drop-down using the sheet and script. I already have the listItem of the dropdown in the script which I am using to set values. I tried using

“Invalid Argument” error with addLabel(label) method

…衆ロ難τιáo~ 提交于 2021-01-29 07:54:59
问题 For a while now, I've been trying to create an autolabeler for Gmail in Google Apps Script. This script parses through an email's body and looks for a line with the form "#DL:", extracts the text after that (which is a date), runs this string through a standardizer I have coded, calculates the date difference between that date and now, and if it's urgent, assigns a color to that. It gets all that information and labels that email. Here is the code I use: var filters = [{ match: /[\n\r][ \t]*

How to I add anchor comments to a Google Doc file programatically

独自空忆成欢 提交于 2021-01-29 07:48:57
问题 I have to add anchor comments to a google doc file using Google App Scripts, but I'm not able to do so. I tried using anchor while using the Document.Comment.Insert method but it does not work. Can anyone please help me by letting me know how to use the anchor functionality or is there any other ways to add anchor comments with help of a program? 回答1: You can create a comment using the Google Drive API v3 instead. I haven't quite figured out the structure of an Anchor for say a Google Sheet

Filter CVS before importing to Google Spreadsheet

本秂侑毒 提交于 2021-01-29 07:40:46
问题 I have a Script in a Google Spreadsheet, the script downloads a zipped CSV from an URL and then import it to the spreadsheet. Actually, the CVS is too big and I don't need all the data from it. My question is, How can I filter the data before importing it to the spreadsheet? For example filter Column A with X value. This is the code I have so far: function descargarzip() { var urldescarga = "http://187.191.75.115/gobmx/salud/datos_abiertos/datos_abiertos_covid19.zip" var url = urldescarga var

How to I add anchor comments to a Google Doc file programatically

折月煮酒 提交于 2021-01-29 07:31:31
问题 I have to add anchor comments to a google doc file using Google App Scripts, but I'm not able to do so. I tried using anchor while using the Document.Comment.Insert method but it does not work. Can anyone please help me by letting me know how to use the anchor functionality or is there any other ways to add anchor comments with help of a program? 回答1: You can create a comment using the Google Drive API v3 instead. I haven't quite figured out the structure of an Anchor for say a Google Sheet

Google Apps script move My drive Files to Team drive folder based on file name

孤街浪徒 提交于 2021-01-29 07:16:41
问题 I am new to Google Apps Script. I'm trying to get for our workplace a script to move files from a single folder on a Google My Drive, over to a Team Drive if part of the filename has a certain phrase. However the script is still moving any and all files from the My Drive source folder to the Team Drive target folder, even those that don't have the "required" phrase in the file name. Example file names used: ALT ADJ 01_03_2018 ALT CHG 01_03_2018 ALT CHG 01_04_2018 ALT PMT 01_03_2018 APX ADJ 01