google-apps-script

Handling multiple rows returned by IMPORTJSON script on GoogleSheets

荒凉一梦 提交于 2021-02-11 07:41:01
问题 I am trying to populate a google sheet using an API. But the API has more than one row to be returned for a single query. Following is the JSON returned by API. # https://api.dictionaryapi.dev/api/v2/entries/en/ABANDON [ { "word": "abandon", "phonetics": [ { "text": "/əˈbændən/", "audio": "https://lex-audio.useremarkable.com/mp3/abandon_us_1.mp3" } ], "meanings": [ { "partOfSpeech": "transitive verb", "definitions": [ { "definition": "Cease to support or look after (someone); desert.",

Parse Nested Json Data to Google Sheets with App Script

三世轮回 提交于 2021-02-11 07:08:53
问题 i'm trying to parse a JSON into a Google Sheets. Everything work like a charm except that i figured out JSON has childitems that i need to return as columns. Json Example { "status": "OK", "items": [ { "order_id": 1290, "date": "2019-12-24", "services": [ { "start_at": "08:00", "end_at": "09:00", "service_id": 121, "assistant_id": 0 }, { "start_at": "12:00", "end_at": "13:00", "service_id": 122, "assistant_id": 0 } ], } ] } And what i need to get into Google Sheets is order_id|date |services

Clone Googlsheet which has formulas/importranges

不问归期 提交于 2021-02-11 06:51:52
问题 I would like to clone/copy a google sheet and locate it in a drive, The script i have at the moment is working for this element but the contents appear blank becuase of formulas/importranges Please can you help with this. Current script is function cloneGoogleSheet2() { const destFolder = DriveApp.getFolderById("xxxxxxxxxxx"); const file = DriveApp.getFileById("xxxxxxxxxxxxxxx").makeCopy("xxxxxxxxx", destFolder); const ss = SpreadsheetApp.openById(file.getId()); const sheets = ss.getSheets();

Google Apps Script EmbeddedComboChartBuilder does not allow changing orientation

拥有回忆 提交于 2021-02-11 06:24:25
问题 I am trying to build a vertical combo chart programmatically. This can be done by setting the "orientation" option of a ComboChart to "vertical" (according to https://developers.google.com/chart/interactive/docs/gallery/combochart) This works fine if you open the JSFiddle below the first image on the page linked above and add the option "orientation: 'vertical'," var options = { title : 'Monthly Coffee Production by Country', orientation: 'vertical', vAxis: {title: 'Cups'}, hAxis: {title:

Trigger an alert at a specific time on Google Script

杀马特。学长 韩版系。学妹 提交于 2021-02-11 05:54:12
问题 I'm very new to scripting so if anyone knows how to do this it'd be great help! I have a user that logs in on business days at ~9 am, and has to do something before 9.30 am. To remind and insist that it's done I want to have an alert that says to do it, if a certain cell is not empty. Ideally it would check at 9, 9.10, 9.20 and 9.30, and pop up each time until it's done. I tried to set up a trigger every 10 minutes, but I read that you can't use triggers with UI. function startCustomTrigger()

Google Apps Script - Send Google Sheet as Email Attachment

霸气de小男生 提交于 2021-02-11 05:51:24
问题 I am currently trying to send a google sheet as an email attachment using Google Apps Script. When I execute the code (shown below) it automatically sends it as a PDF even though I have not specified I want to send it in this format. Is there a way to send the attachment in Google Sheet format? { try { // Get file from Google Drive var googleSheet = DriveApp.getFileById("xxxxxxxxxxxxxxxx") // Send email with file attached MailApp.sendEmail("name@email.co.uk", "Report", "Please see the

Correct setup for accessing a GSheet published as a webapp via a service account

你说的曾经没有我的故事 提交于 2021-02-11 04:29:25
问题 I have a GSheet published as a webapp and I am trying to allow access to it from a service account It is set to allow access to Anyone. I can access it when i hit the deployed app URL directly. I have converted the project to be GCP standard project. I created a Service Account attached to the project. Service account has editor access. I then also granted access to the sheet to the service account. Trying to access it using the following python code and getting a 401. Following examples here

Correct setup for accessing a GSheet published as a webapp via a service account

北城以北 提交于 2021-02-11 04:27:18
问题 I have a GSheet published as a webapp and I am trying to allow access to it from a service account It is set to allow access to Anyone. I can access it when i hit the deployed app URL directly. I have converted the project to be GCP standard project. I created a Service Account attached to the project. Service account has editor access. I then also granted access to the sheet to the service account. Trying to access it using the following python code and getting a 401. Following examples here

Correct setup for accessing a GSheet published as a webapp via a service account

╄→гoц情女王★ 提交于 2021-02-11 04:26:20
问题 I have a GSheet published as a webapp and I am trying to allow access to it from a service account It is set to allow access to Anyone. I can access it when i hit the deployed app URL directly. I have converted the project to be GCP standard project. I created a Service Account attached to the project. Service account has editor access. I then also granted access to the sheet to the service account. Trying to access it using the following python code and getting a 401. Following examples here

Image crop with AppScripts in Sheets or Drive

邮差的信 提交于 2021-02-11 04:20:00
问题 I am evaluating Google Sheets with AppScripts for a report generator. The requirements include inserting images from Google Drive. One of the input image has a fix format, which I need to crop. ( So the dimensions of the original image and the dimensions of the crop is known.) I am looking for a solution to achieve this outcome, but I am struggling. I looked into the following methods: No image crop function in the Drive API No image crop ( only resize) for the Sheets OverGridImage object No