Google Apps Script For Loop

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.ค. 2020
  • 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 TH-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 3 ปีที่แล้ว +2

    Thanks for the informative video.

    • @saperis
      @saperis  3 ปีที่แล้ว

      You're welcome! - Chanel

  • @nutcrakcer4676
    @nutcrakcer4676 2 ปีที่แล้ว +2

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

    • @nutcrakcer4676
      @nutcrakcer4676 2 ปีที่แล้ว

      also, love the choice of colors throughout videos

    • @saperis
      @saperis  2 ปีที่แล้ว

      Happy you like the explanations and the colors. 😀

  • @Xyazul
    @Xyazul ปีที่แล้ว

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

    • @saperis
      @saperis  ปีที่แล้ว

      Wow, thank you! 😀

  • @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

  • @ArneBallegeer
    @ArneBallegeer 3 ปีที่แล้ว

    Very good explanation, thank you

    • @saperis
      @saperis  3 ปีที่แล้ว

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

  • @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. 😀

  • @savant_logics
    @savant_logics 2 ปีที่แล้ว

    Thanks!

    • @saperis
      @saperis  2 ปีที่แล้ว +1

      Happy you liked it! 😀

  • @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

  • @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.

  • @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 TH-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. 🤔

  • @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: th-cam.com/video/Rl0bzCcrZcQ/w-d-xo.html

  • @godfreytaylor9401
    @godfreytaylor9401 2 ปีที่แล้ว

    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  2 ปีที่แล้ว +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 2 ปีที่แล้ว

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

  • @GULSHAN122
    @GULSHAN122 3 ปีที่แล้ว +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  3 ปีที่แล้ว

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

  • @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

  • @devsharma5669
    @devsharma5669 9 หลายเดือนก่อน

    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  9 หลายเดือนก่อน

      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: th-cam.com/video/JKsZoGcYGFk/w-d-xo.html

  • @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! 🤣

  • @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.

  • @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.

  • @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 👍