google-sheets

Google Script to import data from Google trends

喜你入骨 提交于 2021-02-08 10:00:33
问题 just wondering if there is a script to import data from google trends into a google sheet. Basically, I would like to trigger such script daily to know the rising trends for a given topic and I am not sure if there is such solution available. Else, is there any solution to perform this task? Many thanks! 回答1: You may refer with this sample code snippet on how to use Google Apps Script for querying Google trends. For example, this function read input from the spreadsheet and sanitize it, then

Google Script to import data from Google trends

时光毁灭记忆、已成空白 提交于 2021-02-08 09:58:04
问题 just wondering if there is a script to import data from google trends into a google sheet. Basically, I would like to trigger such script daily to know the rising trends for a given topic and I am not sure if there is such solution available. Else, is there any solution to perform this task? Many thanks! 回答1: You may refer with this sample code snippet on how to use Google Apps Script for querying Google trends. For example, this function read input from the spreadsheet and sanitize it, then

Run Google Sheets Add-On as different user

懵懂的女人 提交于 2021-02-08 09:53:39
问题 I have two sheets as "Enquiry" and "Master" with owner as "Admin". In enquiry sheet, I protected few columns and shared across users. Users enter data in enquiry sheet and click on plugin (Add-on). The plugin will copy data to master sheet and enters some data in locked cells. Plugin (Add-on) is throwing error because it is not able to edit locked cells. So I want the plugin (Add-on) to run with Admin account rather than user account or any other way to achieve this solution. Note: Admin and

Run Google Sheets Add-On as different user

情到浓时终转凉″ 提交于 2021-02-08 09:53:39
问题 I have two sheets as "Enquiry" and "Master" with owner as "Admin". In enquiry sheet, I protected few columns and shared across users. Users enter data in enquiry sheet and click on plugin (Add-on). The plugin will copy data to master sheet and enters some data in locked cells. Plugin (Add-on) is throwing error because it is not able to edit locked cells. So I want the plugin (Add-on) to run with Admin account rather than user account or any other way to achieve this solution. Note: Admin and

Automating named Range function in google sheets

删除回忆录丶 提交于 2021-02-08 09:14:51
问题 Context So I have a spreadsheet with 11+ sheets, though will be adding more later. I want to dynamically name the columns using named range. I created a macro script and have been using this. Only the problem is for every sheet, I have to go to the script and change the name of the named range: function NamedRanges() { var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.setNamedRange('TrainlineDate', spreadsheet.getRange('A:A')); spreadsheet.setNamedRange('TrainlinePrice', spreadsheet

Automating named Range function in google sheets

浪子不回头ぞ 提交于 2021-02-08 09:08:47
问题 Context So I have a spreadsheet with 11+ sheets, though will be adding more later. I want to dynamically name the columns using named range. I created a macro script and have been using this. Only the problem is for every sheet, I have to go to the script and change the name of the named range: function NamedRanges() { var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.setNamedRange('TrainlineDate', spreadsheet.getRange('A:A')); spreadsheet.setNamedRange('TrainlinePrice', spreadsheet

Automating named Range function in google sheets

只愿长相守 提交于 2021-02-08 09:08:33
问题 Context So I have a spreadsheet with 11+ sheets, though will be adding more later. I want to dynamically name the columns using named range. I created a macro script and have been using this. Only the problem is for every sheet, I have to go to the script and change the name of the named range: function NamedRanges() { var spreadsheet = SpreadsheetApp.getActive(); spreadsheet.setNamedRange('TrainlineDate', spreadsheet.getRange('A:A')); spreadsheet.setNamedRange('TrainlinePrice', spreadsheet

Remove all grouped rows / columns in a spreadsheet

岁酱吖の 提交于 2021-02-08 08:54:29
问题 I have a Google Sheet that does dynamic grouping with a script. I am looking for a function that gets rid of all those Groups in the sheet again. Similar to expandAllColumnGroups, I would like to have a function called removeAllColumnGroups - but it seems there is no such function available. My current approach is very slow and cumbersome. I did quite some research but could not even find a way to get all the columnGroups or at least the start-column-IDs in a sheet, so I iterate over every

Active Sheet always being leftmost sheet on Google Sheets

陌路散爱 提交于 2021-02-08 08:52:42
问题 Continuation from the previous question: Detect Note changes with onChange I know that this is a duplicate question, but the answers from the questions similar to it have not worked for me. Google App Script getActiveSheet returns leftmost sheet, not active sheet function createSpreadsheetOpenTrigger() { var ss = SpreadsheetApp.getActive(); ScriptApp.newTrigger('onChange') .forSpreadsheet(ss) .onChange() .create(); } function onChange(e) { var ss = SpreadsheetApp.getActive().getActiveSheet();

Issues using setValues function

安稳与你 提交于 2021-02-08 08:15:51
问题 I keep getting an error message when using the setValues() function to export an array to Google sheets. I have tried many different methods for creating my 2D array, but I still keep getting the same errors. Sometimes my code will run (the array will export to the spreadsheet) but I will still get an error. I originally used the setValue() function in a for loop but the code would time out because it ran too long. So I tried dumping all my data into a 2D Array and feeding that to the