Google Apps Script is a JavaScript based programming language.
Do you need to pay to use Google Apps Script? No. All you need is a Gmail account to begin building with Apps Script.
What can Google Apps Script do?
You can use Google Apps Script to add custom menus and sidebars to Google Sheets. You can also be writing codes in Google Apps Script to publish web apps.
You can write custom functions to automate tasks across Google applications such as Google Docs, Google Sheets and Google Forms.
This article covers the basics of Google Apps Script with some practical examples in Google applications. Read on to find out how you can automate and even create new functions in Google Sheets and other Google Applications with Google Apps Script.
You do not have to be a programmer to understand this article. In fact, this is a tutorial-like article targetted at readers without any programming experience.
This article assumes you are familiar with using Google Sheets and other Google applications.
You will be learning how to automate your Google Applications such as Google Sheets, Google Docs, Gmail for increased productivity.
Let’s get started.
You can invoke Google Apps Script in two ways. We will cover one of them here, known as Bound scripts. The other method is known as Standalone Scripts, which we will be covering later.
Start a new Google Sheet.
Type the following into the Google Sheet. Suppose we want to convert the Cost Price in USD to Singapore Dollars.
Follow these instructions to learn how to make a new script.
Click on Tools -> Script editor to open Google Apps Script
Remove the default function codes in Google Apps Script.
function myFunction() {
}
And replace with the following code which will convert U.S. dollars to Singapore Dollars.
function USDTOSGD(dollars){
var singDollars = dollars * 1.32;
return singDollars;
}
At the top of the editor, click Save Project. Click on “Untitled project” and rename it to a Project title of your choice.
Next go back to the Google Sheet. Enter the following formula into Cell B2.
=USDTOCHF(A2)
After a while, Cell B2 lists the Singapore Dollars conversions of the U.S. dollar values!
Congratulations, you have created your first custom function to convert USD to SGD in Google Apps Script.