Google Apps Script For Loop

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • Google Apps Script For Loop - This is one of the basic skills you should learn to master. Handling data from Google Sheets almost always asks for looping over and processing it. For this you use the for loop.
    In this video tutorial I give you a deep dive into Google Apps Script for loop.
    #GoogleAppsScript #GoogleAppsScriptForLoop #GoogleAppsScriptForBeginners
    -----
    saperis - Helping you become a G Suite Pro!
    Sign up to our UA-cam channel for more G Suite, Gmail, Google Docs, Google Drive, etc. videos: / @saperis
    saperis website: saperis.io/
    saperis Linkedin: / saperis
    saperis Twitter: / saperis_io

КОМЕНТАРІ • 50

  • @tarunjain294
    @tarunjain294 4 роки тому +2

    Thanks for the informative video.

    • @saperis
      @saperis  4 роки тому

      You're welcome! - Chanel

  • @nutcrakcer4676
    @nutcrakcer4676 3 роки тому +2

    The slide that shows both the table and arrays highlighted w different colors is an epic way to explain the idea!

    • @nutcrakcer4676
      @nutcrakcer4676 3 роки тому

      also, love the choice of colors throughout videos

    • @saperis
      @saperis  3 роки тому

      Happy you like the explanations and the colors. 😀

  • @Xyazul
    @Xyazul 2 роки тому

    I love listening to you! how you teach makes me really interested on the subject. You are great teacher!

    • @saperis
      @saperis  2 роки тому

      Wow, thank you! 😀

  • @andongbambo
    @andongbambo 2 роки тому +1

    Thank you for a very clear, concise, and helpful presentation.
    At some point in time, would you be so kind to cover how to fetch data from a Microsoft xls format from an email attachment to sheet? or share simple sample code?
    Thanks in advance,

    • @saperis
      @saperis  2 роки тому +1

      Hi Hine. Thank you for your feedback. I can't promise that we'll make such a video.
      But here some information on that subject in the mean time: developers.google.com/apps-script/reference/xml-service

    • @andongbambo
      @andongbambo 2 роки тому

      @@saperis Thanks so much for your help. I will give it a try. Sincerely

  • @GULSHAN122
    @GULSHAN122 4 роки тому +1

    Hello, your video is up to the mark👍
    But if i want to use in Google spreadsheet, so how can i use, pls make a video on it.

    • @saperis
      @saperis  4 роки тому

      Thank you for the feedback. I have several videos on how to use Google Apps Script with Google Sheets on my channel. Greetings, Chanel

  • @Joehtoo
    @Joehtoo Рік тому

    Thanks for sharing this is great!

    • @saperis
      @saperis  Рік тому

      Glad you enjoyed it!

  • @mardibenton7366
    @mardibenton7366 Рік тому

    love your tutorials. Thanks for the content!
    I am trying to figure out how to create a loop with the goal of creating a new profile which
    -generates a new sheet in my drive
    -adds to a parent sheet for tracking (ie manager tracking progress for new employee [new user])
    -appends new employee at the bottom of the employee list
    -links status updates between manager and employee data fields
    all with loops. hahahahha. Horrible explanation but I am a beginner at the beginning of a project so it seems appropriate. Anyway, your insight on any of these matters would be appreciated.
    Otherwise, keep bringing the content

    • @saperis
      @saperis  Рік тому +1

      Well, all I can say is, with lots of lines of codes, you can achieve all you want to. 😀
      If you want to hire a freelancer to help you with this automation you can check this directory: workspacedevs.com/

    • @mardibenton7366
      @mardibenton7366 Рік тому

      @@saperis I am going to use my #3 Learner to pick up what you are putting down. ;)

  • @IdeiascomPlanilhas
    @IdeiascomPlanilhas 2 роки тому

    muito boa didatica entendi perfeitamente . aqui no brasil carece de bons canais assim.. obrigado

    • @saperis
      @saperis  2 роки тому +1

      Happy you liked the video. 😀

  • @ArneBallegeer
    @ArneBallegeer 3 роки тому

    Very good explanation, thank you

    • @saperis
      @saperis  3 роки тому

      You're welcome. I'm always happy when my viewers enjoy my videos. 😀

  • @RalphNgOfficial
    @RalphNgOfficial 3 роки тому

    Thanks, I'd love to know what are the new features on the AppScript Editor UI that Google just added recently

    • @saperis
      @saperis  3 роки тому +1

      Hey Ralph. I'll be using the new editor from now on since it just was rolled out to my account this week.

  • @hagstruan1140
    @hagstruan1140 2 роки тому

    Has anybody thanked you for leaving your mistakes in the video? I'm not kidding. It's hard to explain but I've noticed a couple of your errors before they're corrected on-screen, and it makes me feel a little more engaged? Like if I can notice the mistake, HOW DO I KNOW IT'S A MISTAKE? What have I learned and how does it fit into what you're saying?
    Ugh, this sounds so snarky but I don't mean it that way! I could not fit my head around two-dimensional arrays until you explained it!

    • @saperis
      @saperis  2 роки тому +1

      Well, good to know that my mistakes can be useful. 😀
      When I first started out with Apps Script I had a two dimensional array written out on my whiteboard. This would help me especially when I was writing a loop for the array.
      Nowadays I often log out the data to the console, make a screenshot of it and have a look at it whenever I'm in doubt.
      No shame in using these little hacks.

    • @hagstruan1140
      @hagstruan1140 2 роки тому

      @@saperis When I plan to use an array I draw it on some scratch paper and stick it on my monitor. I absolutely need a visual aid! 🤣

  • @karlsmith9258
    @karlsmith9258 2 роки тому

    Really enjoying your videos. I would love if you could help me or do a video on Apps Script-MySQL. I would love a video on importing a apps script SQL function into a sheet such as using a function that gives you the total of 'whatever' and then import it into a sheet. Basically, combining the SQL results with an apps script code-two codes.
    It does not have to be SQL. I just would like to see how to combine the code of one function into another that transports it into a sheet.

    • @saperis
      @saperis  2 роки тому +1

      I don't think I will be doing any videos about data from a SQL server any time soon.
      Check this video where I access a function from within another function. That's one way how you can do it: ua-cam.com/video/Rl0bzCcrZcQ/v-deo.html

  • @kamamile_tea
    @kamamile_tea 3 роки тому

    Awesome video Thank you!

    • @saperis
      @saperis  3 роки тому

      Glad you liked it! By the way, my Apps Script online course might be interesting for you: courses.saperis.io

  • @anilkale7901
    @anilkale7901 Рік тому

    Can we increment the loop by, a value, say, 2 or 3 or 5 etc.. instead of the standard increment by 1.

    • @saperis
      @saperis  Рік тому +1

      Yeah, you could. But why would you want to do that? The idea behind the loop is to go through every item in the array. If you start incrementing by more than one, you will be skipping elements in the array. Is that your goal?

    • @anilkale7901
      @anilkale7901 Рік тому

      @@saperis
      O! Actually I have a large dataset in which, due a mix-up, I need to capture the value that appears in the 12th column to the right of the cell in every third row of a given column. So, I thought of using a counter that could increment by a value 3 instead of the usual 1. Midway I learned that adding a syntax sequence like += could help. I am trying the following way-
      for (var Index=0; Index

  • @RalphNgOfficial
    @RalphNgOfficial 3 роки тому

    Also, would you be able to give some tutorial about the Google Colab? I found the Colab is very useful in merging data from many Spreadsheets in many Gdrive folders, but there isn't much tutorial available for this.

    • @saperis
      @saperis  3 роки тому +1

      I had to Google "Colab" as I had no idea what it was. I quickly checked it out and must say that it's not a topic I will be covering on my UA-cam channel.
      My aim is to help Google Workspace users automate tasks and workflows with Apps Script. So help people who have no or very little coding experience.
      Google Colab on the other hand requires Python know-how which I personally don't even have. It wouldn't make sense for me to try to teach something I don't know. 🤔

  • @devsharma5669
    @devsharma5669 Рік тому

    Suppose we have data with email id and contact no field. We want to send email to specific email from data in spreadsheet. How can we do that through for or for each loop

    • @saperis
      @saperis  Рік тому

      It doesn't matter what type of data you have. As long as you understand the principal of two-dimensional arrays, you will always find a way to loop over the data.
      Maybe check this video to guide you: ua-cam.com/video/JKsZoGcYGFk/v-deo.html

  • @savant_logics
    @savant_logics 3 роки тому

    Thanks!

    • @saperis
      @saperis  3 роки тому +1

      Happy you liked it! 😀

  • @godfreytaylor9401
    @godfreytaylor9401 3 роки тому

    Very informative video, can you make one on for looping over a dynamic range for a target value/s to be replaced with a certain value? Much thanks

    • @saperis
      @saperis  3 роки тому +1

      Thanks for watching the video. I try to make videos that are useful to many viewers. So typically I'll make videos about something more generic.
      That's the reason why I can't promise that I'll make a video for that specific data handling you are dealing with.

    • @quantumskeptic3586
      @quantumskeptic3586 3 роки тому

      @@saperis Thanks, I've solved it with the createtextfinder method already but just thought it would be interesting

  • @santoshkumar-fv3xb
    @santoshkumar-fv3xb 2 роки тому

    Dark background is not easily visible. It may be better visibility if it recorded in light mode.

    • @saperis
      @saperis  2 роки тому +1

      We have since changed to recording our videos on white background.

  • @adityasingh-ks1kn
    @adityasingh-ks1kn 3 роки тому

    I am not able to view logs because file, view headings are not coming. Please tell how I can view logs.

    • @saperis
      @saperis  3 роки тому

      I'm guessing you are using the new IDE Script Editor. In this case have a look at the top toolbar. There's a thing called Execition Log.

  • @divinorodriguesdasilva5048
    @divinorodriguesdasilva5048 3 роки тому

    Autosum automatic script google sheets...

    • @saperis
      @saperis  3 роки тому

      Is that a question?

  • @jorgenthompquist226
    @jorgenthompquist226 Рік тому

    Just in case anybody actually cares, Apple’s old headquarters (not Google’s) were at 1 Infinite Loop

    • @saperis
      @saperis  Рік тому

      Thanks for setting the record straight 👍