google-apps-script

Is there a way to get Google Sheets to default to a different tab each day?

烈酒焚心 提交于 2021-02-10 17:24:29
问题 I have an MVC application that links to a Google Sheet doc via siteloader. It's loading great but defaulting to load the first tab in the sheets - working as designed obviously. Here's what I need to do: The tabs in this sheet are separated by date. So, for example, today's 8/22/20. The tab displays "SAT 082220." Tomorrow's tab will be "SUN 082320" and so on. I need siteloader to default to today's tab when the project loads. So basically it just needs to load the next tab in the list each

Is there a way to get Google Sheets to default to a different tab each day?

删除回忆录丶 提交于 2021-02-10 17:24:28
问题 I have an MVC application that links to a Google Sheet doc via siteloader. It's loading great but defaulting to load the first tab in the sheets - working as designed obviously. Here's what I need to do: The tabs in this sheet are separated by date. So, for example, today's 8/22/20. The tab displays "SAT 082220." Tomorrow's tab will be "SUN 082320" and so on. I need siteloader to default to today's tab when the project loads. So basically it just needs to load the next tab in the list each

Save a sheet as pdf with onEdit()

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-10 16:18:31
问题 i'm trying to save a google spreadsheet as pdf and mail it to myself everytime, when a specific cell in the spreadsheet is edited. I have the script which saves the spreadsheet as pdf and emails it and it works and I also have an onEdit(e) script which does exactly what I want. But when I put them together it doesn't work. Here's the script: function onEdit(e) { var sheet1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("booking"); var index = sheet1.getRange('O5').getValue(); if(index

How to copy a Google sheet and keep it's project triggers and scripts?

三世轮回 提交于 2021-02-10 16:16:00
问题 I currently have a Google Sheet that I'm using as a master template. That is, I'm making a copy of this template for every request. I want to add a Google App Script (which onEdit POSTs to my server when the sheeting is completed) to my master template that will be duplicated and run for every copy of this template. I've tried doing this from an admin account, however, the scripts don't seem to 'stick' with any of the templates. Is this possible? 回答1: Installable triggers can be attached to

Insert a block of preformatted text at cursor

和自甴很熟 提交于 2021-02-10 16:15:45
问题 I'm trying to automate some boring action in a documentation I'm writing. I would like to be able to insert at cursor position something like this: HEADING3 Some Text BOLD_TEXT1 2x2 table BOLD_TEXT2 2x2 table BOLD_TEXT2 2x2 table Where BOLD_TEXT has the same style (i.e. text dimension 14, grey color and all caps) and the table is page-wide and has the first row colored (i.e green) while the second column has second row with background color. Is it possible without getting mad? I have not

How to copy a Google sheet and keep it's project triggers and scripts?

99封情书 提交于 2021-02-10 16:14:59
问题 I currently have a Google Sheet that I'm using as a master template. That is, I'm making a copy of this template for every request. I want to add a Google App Script (which onEdit POSTs to my server when the sheeting is completed) to my master template that will be duplicated and run for every copy of this template. I've tried doing this from an admin account, however, the scripts don't seem to 'stick' with any of the templates. Is this possible? 回答1: Installable triggers can be attached to

Insert a block of preformatted text at cursor

萝らか妹 提交于 2021-02-10 16:14:16
问题 I'm trying to automate some boring action in a documentation I'm writing. I would like to be able to insert at cursor position something like this: HEADING3 Some Text BOLD_TEXT1 2x2 table BOLD_TEXT2 2x2 table BOLD_TEXT2 2x2 table Where BOLD_TEXT has the same style (i.e. text dimension 14, grey color and all caps) and the table is page-wide and has the first row colored (i.e green) while the second column has second row with background color. Is it possible without getting mad? I have not

how to make a custom function NOT recalculate in Google Sheet

最后都变了- 提交于 2021-02-10 15:43:45
问题 I find that each time i log in. The heavy functions I have do recalculate. IN particular it is functions including UrlFetch that recalculate and make 100s of calls to the url when I log in. I would rather just rely on the data I drew last time. Is there a way to block (haphazard) recalculation? 回答1: Thanks for Ruben's help: Function recalculation cannot be disabled. the workarounds are (1.) to make a "switch" input to the function, which while in "don't update state" would make the function

Apps Script Execution API 404 error with devMode: true

给你一囗甜甜゛ 提交于 2021-02-10 15:42:17
问题 When requesting POST https://script.googleapis.com/v1/scripts/{script_id}:run with devMode: true I get a 404 error. I can run the script successfully with devMode: false . Although other people (1, 2) have raised this issue, none of the other solutions work. I keep getting an HTTP 404 Not Found error whenever my request comes with devMode: true . I have performed the following steps: created a new Google account created a Cloud project set up an OAuth consent screen for the project authorized

500 error on UrlFetchApp

被刻印的时光 ゝ 提交于 2021-02-10 15:16:18
问题 I am trying to pass data of a product list from Magento API to Google Spreadsheet. No authentication was required for the Magento API as I was retrieving the data as a Guest. The API is working perfectly with RestClient. However, 500 error occurred when fetching the REST resource from Googe Apps Script. Exception: Request failed for http://mymagentohost/api/rest/products?limit=2 returned code 500. Truncated server response: Service temporary unavailable (use muteHttpExceptions option to