r/GoogleAppsScript • u/MaineLady5 • Jul 20 '23
Question Help - where to start learning process?
Hey,
I'm an accountant whose really good at complex functions in sheets & excel. I see a huge benefit from learning Google App Script in my work, but I have no idea where to even start. Ideally I'd love to learn to pull data from outside sources to bring into my sheets. My work will pay for me to learn this, and I understand it'll take a long time.
My question here is, where do I even begin? Do you have any good suggestions of courses I could take?
Much appreciated!
12
Upvotes
3
u/Kanegarooo Jul 21 '23
If you don't currently have programming experience & you're just trying to learn for the Apps Script use-case then I suggest learning on a problem to problem basis. Its a lot easier to learn when you have real problems to work with.
For JavaScript, learn the basics:
let and const
function declaration
data types and data structures
loops and iteration
console.log, or Logger.log (Google Apps Script specific
The list could go on, but start with these more simple topics.
From here you can learn to break down your problems into parts.
Let's say you want to sum up some adjacent cells, these would be the broad steps:
Declare the workbook & sheet that contains your cells
getRange() of the cells and getValues() of the range
From here, there are a plethora of ways to add all of the value together so this is a good opportunity to walk you through what you may experience.
Assuming you learned about arrays, you may notice that the Apps Script docs tell you that
getValues()results in this:A two-dimensional array of value is a lot different than just an array, this is a roadblock for you.
Like I said, there are a lot of ways to do things in programming. Consider looking up:
'how to add all values in a two dimensional array JavaScript'
or
'two dimensional array to one dimensional JavaScript'
note, I'm adding JavaScript to the search because the syntax varies between languages
Additionally, consider using Google search parameters to make your searches more efficient. A common site people look towards for programming help is stackoverflow. If you want results from this site, try:
site:stackoverflow.com: {your question here}
Of course, this is barely scratching the surface of how you can learn, and this may not be the best way for you. The reason I recommend sticking with the very basics of JavaScript and learning from a problem-based approach is that JavaScript, as well as any other language, is a lot. At the end of the day though, you don't really need to learn about more intermediate concepts like prototypal inheritance, closures, binding, etc.
Some final thoughts/tips:
If you start running into problems with efficiency or the Google Apps Script quotas, remember that the most efficient Google Apps Script is using less of it; try using Apps Script for reading and writing data while doing manipulations with JavaScript.
Algorithms are your friend. If you find yourself manipulating a lot of data, consider what kind of manipulation you're trying to perform and research an algorithm that may fit your use case.
Keep it simple until you're comfortable. Don't try to solve problems in the most clever way you can. Most problems can be solved by throwing more code at it, for lack of a better way to word that. You're just getting started so you don't need everything to be perfect. Worry about opalization as you continue learning.
Lastly, and most important in my opinion, take this all with a grain of salt. There are many useful suggestions by the time I'm commenting this. Consider all of these suggestions as your options and spend some time vetting each one. Like marth141 said, "Asking here is a great place to learn" and this will be one of your most powerful tools.
Good luck! Feel free to reach out if you have any questions