Append a row of data to a Google Sheet with Google Apps Script

แชร์
ฝัง
  • เผยแพร่เมื่อ 16 มิ.ย. 2024
  • The Starter Sheet: docs.google.com/spreadsheets/...
    Learn the basics of appending row data to the bottom of a Google Sheet with Google Apps Script. This can be a handy tool if you are creating an input sheet for a data log or even if you are importing data from another location into a Google Sheet tab.
    This tutorial is part of the: Building a Data Log in Google Sheets with Google Apps Script series. Link to the playlist here: • Building a Data Log in...
    If you like the video, check out my website:
    yagisanatode.com/
    You can find out more about how to append and manipulate Google Sheets data in these tutorials:
    - Copy and Paste Range Values from one Google Sheet into another with Google Apps Script • Copy and Paste Range V...
    - Google Apps Script - Copy Selected Columns in One Sheet and Add Them To The Bottom of Different Selected Columns in Another - yagisanatode.com/2018/11/17/g...
    - Google Apps Script: Get the last row of a data range when other columns have content like hidden formulas and check boxes [updated Dec 2021] - yagisanatode.com/2019/05/11/g...
    - Google Apps Script Course - Part 1: 2D Array Data Transformation of Single Question Item Data to Total Count of Choices in Google Sheets - Google Apps Script Course - Intro: 2D Array Data Transformation for Google Sheets - yagisanatode.com/2019/12/22/g...
    - Creating Unique Ranges from 2D Arrays in Google Apps Script - yagisanatode.com/2020/10/26/c...
    - Google Apps Script: Add and removed Google Sheets columns based on a search array - yagisanatode.com/2020/03/28/g...
    00:00 Intro
    00:33 Basic example
    03:43 Example 2 extract from Input Sheet and append to DataLog
    09:19 Clearing the input range after use.
    10:19 Pitfalls of the appendRow() method.
    11:43 Alternative to appendRow()
    11:58 Up next.
    Here is the link to just Google Apps Script tutorials:
    yagisanatode.com/google-apps-...
    #GoogleSheets #GoogleWorkspace #GoogleAppsScript #AppsScript #Spreadsheets

ความคิดเห็น • 30

  • @ryanclapham
    @ryanclapham 4 หลายเดือนก่อน +1

    Just what I was looking for, thank you :)

    • @yagisanatode
      @yagisanatode  4 หลายเดือนก่อน

      Glad I could help!

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

    thank you too muchs veeeeeery functional

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

    Thanks for the tutorial, your videos & blog Apps Script has been super helpful. Would you consider doing a tutorial on retrieving data sent via webhooks to a Google sheet?

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

      Hi Brad, Definitely something to add to the list. In the mean time I do have a tutorial on receiving webhook data into a Apps Script webapp and adding the results to a Google Sheet using the Teachable webhooks. The whole process it similar across the board so you could adapt it to your own needs. Here is the link: yagisanatode.com/2021/11/30/how-to-automatically-share-teachable-students-to-google-drive-files-and-folders-when-they-enroll-in-your-course/

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

    Good job

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

    Thanks!

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

      You're welcome! Glad it was useful for you.

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

    Hi! Can I modify this easily to append data into emtpy columns to the right on Sheet1 as new data appears in a table in Sheet2? Or would that be a whole nother ball of wax.

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

      It's a little bit of a different. If the data appears dynamically, say from an API or a query then you will need to use a time trigger to handle the updates th-cam.com/video/MiWfaCNRzsA/w-d-xo.html

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

    hey, I liked your video but I have a question. Can we use the appendRow method in a specific row location? like for example I wanted the data to start from Q column 100th row.

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

      Hi Muhammed, appendRow() is based on the data region of an entire sheet, so unfortunately, no. I've got a bunch links to alternate solutions in the description. I think you will find one of these will have a solution for you.

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

      @@yagisanatode i have the same question, but if its not possible, is there a way that appendRow() can be used in a sheet that has formula on other columns?

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

      @@trisha_inteli2438 Hi, no appenRow() will navigate to the last row of all the data in the sheet. You can find a tutorial more directly related to your query here: yagisanatode.com/2019/05/11/google-apps-script-get-the-last-row-of-a-data-range-when-other-columns-have-content-like-hidden-formulas-and-check-boxes/

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

    Thank you, I am sorry I cannot afford these days a price of a cup of coffee!:(

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

    What I really want, is to paste the collected Data into a NEWLY INSERTED ROW, 1 Row ABOVE the last Row in the Sheet... Can anyone help me!?
    This video is very helpful, I have learned a lot! Thank you!

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

      Hi Beaux. That is definitely a good topic for a tutorial. I will add it to the list. In the mean time have a look at sheet.insertRowAfter(1) developers.google.com/apps-script/reference/spreadsheet/sheet#insertrowafterafterposition

  • @user-wo3qc1ox9q
    @user-wo3qc1ox9q 10 หลายเดือนก่อน +1

    Around the 5:55 mark, what if you don't know how many rows of data are going to be there every time? Instead of A2:E2, is there a way I can grab however many rows there are, whether it be 2 rows one day or 10 rows the next? Thanks!

    • @user-wo3qc1ox9q
      @user-wo3qc1ox9q 10 หลายเดือนก่อน +1

      Never mind. Just watched the pitfalls section 😭

    • @yagisanatode
      @yagisanatode  10 หลายเดือนก่อน

      All good. There are a few other links to different approaches in the description of the tutorial.

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

    How do I update a single cell data instead of appending a new row?

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

      You can use something like sheet.getRange("B4").setValue("here!")

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

    How to append Multiple columns

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

      Check out the links in the description. You should find something there that will help you ;) .

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

    How we solve that problem which is coming in the end of the video how we solve that

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

      Check out the links in the description. I have a number of tutorials there that will help you out.

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

      @@yagisanatode what I need to add here can you please tell me how I rectify that because I still can't understand what I need to do here after watching the tutorial on websites

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

      @@GhoulGamingYT I'm not 100% certain what you need here, sorry. I mention a few gotchas at the end. I'm going to take a guess, apologies if I am wrong.
      If you need to append data to a row that already contains data in other columns, then you will need to find the last row using these methods yagisanatode.com/2019/05/11/google-apps-script-get-the-last-row-of-a-data-range-when-other-columns-have-content-like-hidden-formulas-and-check-boxes/ then you can apply .getRange(*start row*, *start col*, *data depth*, *data width*).setValues(*data*) replacing values inside the *. I hope this helps.

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

      @@yagisanatode ok thanku