How to force newlines in Google Apps jsdoc descriptions

This method worked for me. In markdown (or in StackOverflow), you need to have two line breaks (ie an additional one) to start new line (or paragraph). same method worked for JSDoc /** * Converts the prefixed value to the specified base. * * Requires one of the following prefixes: * * ‘0b’ Base 2: … Read more

You do not have permission to call “UrlFetchApp.fetch”

onEdit is invoked by a Simple Trigger when a user changes a value in a spreadsheet. However, simple triggers cannot access services that require authorization, such as UrlFetchApp.fetch. See the Google Apps Script guide What you can do is to simply rename the function onEdit to something else, such as atEdit, so as to remove … Read more

How do you create a “reverse pivot” in Google Sheets?

I wrote a simple general custom function, which is 100% reusable you can unpivot / reverse pivot a table of any size. In your case you could use it like this: =unpivot(A1:D4,1,1,”customer”,”sales”) So you can use it just like any built-in array function in spreadsheet. Please see here 2 examples: https://docs.google.com/spreadsheets/d/12TBoX2UI_Yu2MA2ZN3p9f-cZsySE4et1slwpgjZbSzw/edit#gid=422214765 The following is the … Read more

How to get the current time in Google spreadsheet using script editor?

use the JavaScript Date() object. There are a number of ways to get the time, date, timestamps, etc from the object. (Reference) function myFunction() { var d = new Date(); var timeStamp = d.getTime(); // Number of ms since Jan 1, 1970 // OR: var currentTime = d.toLocaleTimeString(); // “12:35 PM”, for instance }

You do not have permission to call openById

I thought that I would throw in a similar issue that I had which brought me to this question, where I received the error You don’t have permission to call by openById. In my case I was trying to call functions from translate.gs which I copied from this example: https://developers.google.com/apps-script/quickstart/docs Note that at the top … Read more

Get column values by column name not column index

The following function retries the value in a column with a given name, in a given row. function getByName(colName, row) { var sheet = SpreadsheetApp.getActiveSheet(); var data = sheet.getDataRange().getValues(); var col = data[0].indexOf(colName); if (col != -1) { return data[row-1][col]; } } Specifically, var col = data[0].indexOf(colName); looks up the given name in the top … Read more

How to automatically import data from uploaded CSV or XLS file into Google Sheets

You can programmatically import data from a csv file in your Drive into an existing Google Sheet using Google Apps Script, replacing/appending data as needed. Below is some sample code. It assumes that: a) you have a designated folder in your Drive where the CSV file is saved/uploaded to; b) the CSV file is named … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)