[MUSIC PLAYING]
SPEAKER: In our Sheets to Apps series,
we've covered dozens of custom apps
that you can build from a spreadsheet
that help automate an array of tasks, such as sending email
alerts, generating presentations or reports,
performing multiple calculations simultaneously, connecting
to a database or other apps, and many other use cases.
Apps Script is what has made all of these custom scripts
possible, and it has been around for over a decade now.
You can create a script in Apps Script
by recording your steps using the macro recorder,
or you can write your own JavaScript code
using its editor by visiting the top menu
called Tools, Script Editor in a Google Sheet.
It's automatically powered by serverless Google Compute
resources and is also built into many products, such as Google
Workspace, Google Docs, Slides, and many other Google products.
The editor is part of the Integrated Development
Environment or IDE, and it has been enhanced along
with other functionality in order
to make the experience of writing scripts even better.
And so over the next few minutes,
I will walk you through some of these exciting new
improvements.
Welcome to the Sheets to Apps Show, where we show you
how to tame these tabular beasts into productive applications.
The first obvious change is its new modern look,
which uses material design components, making
it look sleek and spacious.
This helps you navigate menu options and project settings
in an intuitive manner.
There's more space on the left navigation bar,
and you can collapse long chunks of code
or move the order of files to ensure they
execute in the desired order.
There's also a very helpful icon when it spots
that there's a syntax error.
One of the historical advantages of using the Apps Script editor
is that it contains a library of actions built in for you
to construct your scripts, such as getActiveSheet
or sendEmail to quickly name two,
that you can insert with its autocomplete feature
when typing in period.
In this new launch, the autocomplete box
now displays documentation about the function you are using,
saving you time in having to look up its purpose or syntax
rules from a separate window.
This is especially helpful when collaborating
with others who create custom actions
and you wish to learn more from the user defined functions.
It also autocompletes things like apostrophes
and makes indentations explicit when using
both the Spacebar or Tab key.
When writing a script, it's common to want
to rename functions or variables as your design evolves.
And so the ability to find and replace text
is very useful, which you can do by clicking the keyboard
shortcut F1 and selecting the option called Rename Symbol.
You can also customize your editor by also selecting F1
and change the zoom or switch to dark mode
by choosing the Toggle High Contrast
Theme from the list of options.
Another great addition to the scripting experience
is the ability to review the actions your code is
interpreting and streaming these logs in real time
and in different colors by clicking Execution Logs, then
Run.
Before, you had to open a separate dialog
box after a function completed.
You can also review different types of logs
in the console, such as console.time,
which starts a timer to track how long an operation takes.
Streaming logs and debugging tools
were two key asks made by users.
And so I'm happy to also share that, similar to Chrome
Debugging, you can now create an object with different data
types, such as a string and an array of numbers,
then enter a breakpoint when the object is created to see
what happens in that variable.
For example, you can place a breakpoint at line 3,
then click Debug.
This calls the function named main in debug mode
and keeps running until it reaches the break point.
We can see a few options to the right.
There's Step Over, which jumps over to the next line.
Step In steps into the function.
Step Out continues to run the program
until it reaches the end of the current function.
Resume continues to run the program
until it reaches another break point or the end
of the program, because you can have multiple break points.
Next, you can also connect your script to other Google services
by enabling these directly in the UI.
And next, sharing a script with others
can be done by copying a sheet with the code
or pasting code into your own editor.
However, when you want to make your script
available as an installable app for anyone in your organization
or on the public marketplace, you
can also deploy it as an add on.
You can optionally deploy it as a web app
as well if you wish to create a custom interface out of HTML
for small teams to input data into, especially
if it's for 30 or less users accessing it simultaneously,
like the one covered in the Gigster Staffing Tool blog
post linked in this video's description.
It is also common to want to connect a script with cloud
computing options that are hosted by Google,
such as machine learning or databases.
And for that, you can connect your own Google Cloud project
directly in the settings of the editor.
For those power users of Apps Script, as of this recording,
additional features will continue to be added.
And so if you do not see a feature that
was crucial to your experience in the prior editor,
you can switch back and forth with the new editor.
And there you have it, a quick summary of the new Apps Script
features launched that improve the developer experience.
And community, if you found this episode helpful,
please click Like and subscribe to the channel
for future videos.
Cheers.
[MUSIC PLAYING]