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

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ม.ค. 2025

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

  • @saiupalekar8176
    @saiupalekar8176 10 วันที่ผ่านมา +1

    You are a saviour!!

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

    Thanks!

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

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

  • @MartinSaindon-z7w
    @MartinSaindon-z7w ปีที่แล้ว +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!

    • @MartinSaindon-z7w
      @MartinSaindon-z7w ปีที่แล้ว +1

      Never mind. Just watched the pitfalls section 😭

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

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

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

    Just what I was looking for, thank you :)

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

      Glad I could help!

  • @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!")

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

    thank you too muchs veeeeeery functional

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

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

    Good job

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

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

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

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

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

  • @KopiPaste-zw1bb
    @KopiPaste-zw1bb 5 หลายเดือนก่อน

    I keep getting the error message that it cannot read Cannot read properties of undefined (reading 'getRange')

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

      What's happening on the line that the error occurred on?

    • @KopiPaste-zw1bb
      @KopiPaste-zw1bb 5 หลายเดือนก่อน

      @@yagisanatode so i ended up starting over because it wasnt working and now it tells me "TypeError: ss.getSheetByName is not a function'? i didnt change anything but the sheet name and range from a1:e1 to the location where i have the info which is b8:e8.

    • @yagisanatode
      @yagisanatode  5 หลายเดือนก่อน +1

      @@KopiPaste-zw1bb It looks like you are referencing the entire spreadsheet by calling the `ss` constant variable, rather than the desired sheet. You could try `const targetSheet = ss.getActiveSheet()` for an active sheet.

    • @KopiPaste-zw1bb
      @KopiPaste-zw1bb 5 หลายเดือนก่อน

      @@yagisanatode thankk you so mcuh!!!!!!!!
      i dont quite understand as i am very new to this but i really appreciate your reply and help

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

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

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

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

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

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

      @@yagisanatode ok thanku

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

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

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

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

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

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

    How to append Multiple columns

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

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