google-apps-script

Google Webapp: How to dynamically pass array values to jquery script

这一生的挚爱 提交于 2020-02-03 23:38:07
问题 I've been working on an answer to StackOverflow question Datepicker: Disabling dates in the data. I've successfully developed a small webapp that excludes specific dates from a jQuery Datepicker using the beforeShowDay option and an array of hardcoded dates. Problem At present, the array of excluded dates is hard coded, but these dates should be generated dynamically. Although I have a function in code.gs getuserdates() which will return the "userdates" array ["12/13/2019", "12/14/2019", "12

Unable to connect google apps script to mysql through localhost

一曲冷凌霜 提交于 2020-02-03 01:59:30
问题 Getting the error :"Failed to establish a database connection. Check connection string, username and password. " if I run the following script.I am able to connect locally through mysql workbench but unable to do so with googleapp script.Don't know where I am goin wrong .Also,do i need to set triggers if i write the script for a spreadsheet . function test() { var conn = Jdbc.getConnection("jdbc:mysql://127.0.0.1:3306/test", "root",""); var stmt = conn.prepareStatement("SELECT * FROM info;");

Unable to connect google apps script to mysql through localhost

最后都变了- 提交于 2020-02-03 01:59:26
问题 Getting the error :"Failed to establish a database connection. Check connection string, username and password. " if I run the following script.I am able to connect locally through mysql workbench but unable to do so with googleapp script.Don't know where I am goin wrong .Also,do i need to set triggers if i write the script for a spreadsheet . function test() { var conn = Jdbc.getConnection("jdbc:mysql://127.0.0.1:3306/test", "root",""); var stmt = conn.prepareStatement("SELECT * FROM info;");

Is it possible to set Notes with automatically inserted values using google sheets?

蓝咒 提交于 2020-02-02 11:27:26
问题 I was trying to figure out a way to insert Notes automatically, when i enter something in a specific cell. This thread was suggested to me and tried it out: https://support.google.com/docs/thread/13317657?hl=en. I changed the function mentioned a littlebit, to fit my project: function onEdit(e) { if(e.source.getActiveSheet().getName() === 'Testsheet') { if(e.range.columnStart === 8 && (e.range.rowStart > 12 && e.range.rowStart < 21)) { return e.range.offset(0, -6).setNote(e.value); } } } This

Create function in Google sheet to get my external IP address

眉间皱痕 提交于 2020-02-02 03:42:32
问题 I need to create a function in Google sheet to get my external (public) IP address I tried use function =IMPORTXML("https://api.myip.com","//body") , but this method shows diffrint IP address not my external IP address 回答1: The following solution makes use of a custom menu in the Spreadsheets - function onOpen(e) { SpreadsheetApp.getUi() .createMenu('My Menu') .addItem('Get IP', 'getIP') .addToUi(); } function getIP() { SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().appendRow([JSON

How to Connect Google Data Studio with Google App Script?

生来就可爱ヽ(ⅴ<●) 提交于 2020-02-01 09:39:27
问题 I searched a lot on Internet, I think, not much or no one worked on Google Data Studio on scripting level. API's are available but I don't know how can I connect my Data Studio project with script to run any stuff using scripting. To connect script with google other Apps we rite following Api's: var GoogleSheet= SpreadsheetApp.getActiveSpreadsheet(); var Googleform = FormApp.openById('18LxHulaJgQJtDZMf7EpyHQkqIpZ2K7AcIG6PRVsrZ20'); etc. But to connect with Data Studio there is something

How to Connect Google Data Studio with Google App Script?

你说的曾经没有我的故事 提交于 2020-02-01 09:37:28
问题 I searched a lot on Internet, I think, not much or no one worked on Google Data Studio on scripting level. API's are available but I don't know how can I connect my Data Studio project with script to run any stuff using scripting. To connect script with google other Apps we rite following Api's: var GoogleSheet= SpreadsheetApp.getActiveSpreadsheet(); var Googleform = FormApp.openById('18LxHulaJgQJtDZMf7EpyHQkqIpZ2K7AcIG6PRVsrZ20'); etc. But to connect with Data Studio there is something

getvalues() returns a complete date in the year 1899 for a cell containing only time

岁酱吖の 提交于 2020-01-30 11:58:46
问题 If we have only a time in say cell A1 of Google sheets. For example, I have this: 8:09:00 AM When I use this to fetch the contents of the cell: sheet.getRange(1, 1).getValue(); this is what it returns: Sat Dec 30 1899 08:09:00 GMT-0500 (EST) Why is this happening? Any way for getvalue() to stop interpreting the data and get the raw data instead? Note: No special formatting has been set by me for the cell. So I guess the formating is the default (automatic), which is not something I want to

getvalues() returns a complete date in the year 1899 for a cell containing only time

≡放荡痞女 提交于 2020-01-30 11:58:05
问题 If we have only a time in say cell A1 of Google sheets. For example, I have this: 8:09:00 AM When I use this to fetch the contents of the cell: sheet.getRange(1, 1).getValue(); this is what it returns: Sat Dec 30 1899 08:09:00 GMT-0500 (EST) Why is this happening? Any way for getvalue() to stop interpreting the data and get the raw data instead? Note: No special formatting has been set by me for the cell. So I guess the formating is the default (automatic), which is not something I want to

Google Script Lock Cells

こ雲淡風輕ζ 提交于 2020-01-30 09:23:08
问题 I am trying to implement a script that locks a certain range of cells when a condition is true. Here is the link to my document: https://docs.google.com/spreadsheets/d/1XShGxlz2fA2w2omth-TvYc7cK0nXvVMrhwRKafzVjOA/edit?usp=sharing Basically I am sharing this document with a group of people so they fill their mail addresses in column B and put a number 1 in column C so it increments my counters for each slot. What I am trying to do is to lock each slot when it is full so other people can no