The best way to bring back some sunshine to your life is to get rid of the boring tasks. How to do that? By automating everything! During the next few paragraphs I will guide you through the basics, use cases and how to start using machines to do your dirty work.
What is Apps Script?
Apps script is a coding environment by Google that facilitates coding and connecting services like Spreadsheets, Docs, Slides and others. The full list is available in the developer documentation.
How to code in Apps Script?
Of course the number one reason to learn coding is to create your own Artificial Intelligence that will conquer the world, but there are also some other reasons.
- Limit developer involvement and speed up implementation – For a lot of companies this a real problem. Devs are stretched to the limit. Priorities change daily. Backlog gets fatter by the minute. Marketing tasks get pushed back to the very end. Unfortunately this is our reality. I have worked with a client that was implementing the enhanced eCommerce dataLayer schema for 6 months. Not joking. If you do even a part of the implementation yourself it will help.
Know limitations and understand technology – It’s very important to understand the basic limitations. For example:
- Why variables can be undefined
- How async works
- How JS can impact website performance
Apps Scripts New Coding UI Overview
- List of all the files in your Apps Script Project
- You can reuse code that you have previouslu written by using them as libraries
- Click to enable additional services in your project like GMail, Google Analytics or others.
- The execute button.
- You can choose the function you want to run from the dropdown menu
- Execution log to preview the result.
- If you want to get access to your app or to use it as an API you can deploy it to the public.
Apps Script Examples and Use Cases
There is a lot of potential uses for Apps Script automation. Let me list some of the simple ones:
- sending automated email reminders – this is a great case for automating and letting the robots take care of everything.
- listing all of the sheets in a spreadsheet – have you ever worked on a spreadsheet that constantly gets bigger and you loose control over the files. You can write a script that creates an index sheet and refreshes it on every open of the file
- retrieve the pages from sitemap.xml – this is a great idea for SEO.. When you need to get a list of all the pages from the website into a spreadsheet using a script makes it easy.
- get data from and API – if you need to retrieve data from an API the best way to do it is using a script. For example you sales data, marketing data or similar.
- sending emails with reports – do you have a report set up that you would love to share with your colleagues on a regular basis? Apps scripts is the way to go. You can send email with a PDF report attached just by writing a few lines of code.
Where to get started with coding in Apps Scripts
There is a lot of places where you can learn Apps Scripts. I would like to recommend the ones listed below:
Useful Tips and Tricks
- Dark mode – to enable Apps Script dark mode please press F1 and select “Toggle High Contrast Theme”
- You can color your console logs with different colors
Let’s bring this one home
Apps script is a power house. With functions ranging from fetching data from external APIs, through connecting with Google Services like Youtube or Google Analytics, to sending reports via email the possibilities are endless. Sometimes you will feel frustrated, sometimes you will code for hours at a time, my advise is – just enjoy the journey 🙂 .