You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
😼
Cat face with wry smile
Alex Ivanov
oshliaer
😼
Cat face with wry smile
Code explorer | Node.js, Microservices, ML, Serverless, AI | Seeking remote FT/PT roles | Eager to learn, improve English & collaborate
Converting a1Notation to GridRange for Google Sheets API
Converting a1Notation to GridRange for Google Sheets API
When it uses Google Sheets API v4, GridRange is used for it as the range property. These sample scripts are for converting from a1Notation to GridRange. You can chose from following 2 scripts. Both scripts can retrieve the same result.
Initially intended to extend G Suite apps, I like to think of Google Apps Script as a gateway to more kinds of development.
Think of it as workflow glue and the power of programming that can interract with Google Apps and external APIs too!
Purpose
Provide a living document for whenever someone asks, " so, how do i get started with Google Apps Script?".
Working Outline
Just the orgainizing principles and some key links.
1 Starting point: Good Things to Keep in Mind
Scripts are 'bound' to a container like sheets, docs, slides or forms. These can be accessed from the containing doc and opened say in sheets by going to the menu Tools > Script editor. Scripts can also be standalone for addons or web apps.
Your script home page is a dashboard found here script.google.com. The help link there will get you to an explanation of the dashboard.
These sample scripts are for requesting multipart post using Google Apps Script.
In most cases, the multipart request is used for uploading files. So I prepared 2 sample situations as follows. For each situation, the request parameters are different.
Upload a file from Google Drive to Slack.
Convert an excel file to Spreadsheet on Google Drive using Drive API v3.
This is a sample of Google Apps Script. This script is for retrieving all files and folders under a folder on Google Drive. All files and folders in the specific folder can be retrieved.
If you want to retrieve file list with all files and folders on Google Drive, please use DriveApp.getRootFolder().getId() as folderId.
When there are a lot of files in the folder, it may be over the limitation time to execute script.
Script for Google Forms. Uses "Other" field in checkbox and radio groups to add options from responses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.
The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.
Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.
Using Function Scope to Create Public and Private Methods
Curl bash script for getting a Google Oauth2 Access token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters