google-apps-script

In a Google Document how to set a tables multiple rows' height to match the cell content size?

被刻印的时光 ゝ 提交于 2020-06-29 04:14:24
问题 I can click and drag each horizontal line one by one manually to match amount of content of the cell above it (how many lines of text it has), but what if you have 100 rows? How can you get from top to the bottom table here without manually dragging each horizontal line? So, if there is ONE line of text in the whole row height wise, I want the table be ONE line height, not 10 like in the below case in abc row. 回答1: This can be achieved using a bound-to-your-Doc Google Apps Script. You can

GAS: Error 500 while connecting to an API

允我心安 提交于 2020-06-29 04:13:27
问题 I'm trying to connect to Cloud Waitress API, a solution for restaurants, Documentation: https://apidocs.cloudwaitress.com/#orderpromos It's documentation gives an example on how to connect to the API: curl https://api.cloudwaitress.com/v1/orders \ -X POST \ -H "Content-Type: application/json" \ -H "Authorization: YOUR_API_KEY" \ -d ` { "restaurant_id": "xxxxxxx", "limit": 10, "page": 1, "sort": { "created": -1 }, } ` I tried to create a Script in GAS to get the information back to a

How to run multiple onEdit functions in the same google script (google sheets)?

只谈情不闲聊 提交于 2020-06-29 04:08:10
问题 I've been trying many different ways and none worked. I want a function that when someone types something, the content of the cell automatically turns upper case and eliminate all accents. E.g.: if I type "áéîõÂÃüÚ", it immediately becomes "AEIOAAUU". The following cases I've tried: Change the letter with accent for a normal letter then uppercase everything, in the same onEdit; Separate the functions in different onEdit; Just one onEdit that calls the functions in another script. This is my

How to send GET request with google OAuth2 and Java to script.google.com web page?

 ̄綄美尐妖づ 提交于 2020-06-29 04:07:48
问题 GET is working for me but I get google services authorization page when I send it. I read guides from google but still don't understand how to use Credentials right. This thing is for managing script files itself and have nothing to do with my problem :/ Would be decent if it is possible in Java 回答1: After sign in google you will be redirected on redirect page with google code. Redirect page could be set in google private user console. When you will get google code you could use code for

How to run multiple onEdit functions in the same google script (google sheets)?

风格不统一 提交于 2020-06-29 04:07:17
问题 I've been trying many different ways and none worked. I want a function that when someone types something, the content of the cell automatically turns upper case and eliminate all accents. E.g.: if I type "áéîõÂÃüÚ", it immediately becomes "AEIOAAUU". The following cases I've tried: Change the letter with accent for a normal letter then uppercase everything, in the same onEdit; Separate the functions in different onEdit; Just one onEdit that calls the functions in another script. This is my

How do I add a new value to a Google Sheet from a text field in a Web App and then automatically update the associated dropdown?

不想你离开。 提交于 2020-06-29 04:02:13
问题 WARNING: I'm not a programmer by trade. Ok. Got the disclaimer out of the way. So this might not be the best way to do this but here is the scenario. I have a dropdown that gets populated via a Google Sheet. The user chooses a selection from the list but this dropdown does not have all of the possible values it could have. There will likely be a time when the user needs a new value added. While I could manually update the spreadsheet as new values are requested that introduces an element of

Can I inject conditional formatting from Google Sheets into Google Slides using Google Apps Script?

依然范特西╮ 提交于 2020-06-29 03:58:08
问题 I've created a script that allows me to use data stored in a Google Sheet to generate a set of Google Slides (based on a pre-formatted template slide). RAGStatus in the script below references a cell within the Google Sheet that has conditional formatting. If the cell states "Red" then the cell is filled with red colour. When I run the script, the correct data is injected into the Google Slide, but appears as a text string without the colour formatting. Is there a way to inject the data and

Best Practices for Multiple OnEdit Functions

空扰寡人 提交于 2020-06-29 03:48:14
问题 Problem I have 6 OnEdit Functions, which work as intended individually, but when together they don't work as intended. By this I mean some simply don't trigger. Properties of the Script They have different names - function onEdit(e) {code}, function onEdit1(e1) {code}, function onEdit2(e2) {code}, function onEdit3(e3) {code}, function onEdit4(e4) {code}, function onEdit5(e5) {code} They are all in the same .gs tab Some of them have the same variables. For example OnEdit has var range = e

How to pass variables into an HTML body

徘徊边缘 提交于 2020-06-28 11:15:29
问题 I have created this script that allows me to select a certain food item and the serving size and then it calculates nutritional value, adds it to a database, sums it all at the end of the day and sends me an email with an overview. It almost all works, I am just having trouble passing some variables from my script into the HTML formatted email. In the portion of the code below, totals is the data values from a spreadsheet range. I expect the retrieved values of calories , caloriesFromFat ,

How to pass variables into an HTML body

感情迁移 提交于 2020-06-28 11:15:29
问题 I have created this script that allows me to select a certain food item and the serving size and then it calculates nutritional value, adds it to a database, sums it all at the end of the day and sends me an email with an overview. It almost all works, I am just having trouble passing some variables from my script into the HTML formatted email. In the portion of the code below, totals is the data values from a spreadsheet range. I expect the retrieved values of calories , caloriesFromFat ,