Google Apps Script: How to get Spreadsheet

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 มิ.ย. 2024
  • How can you get a spreadsheet with Google Apps Script?
    I'll be covering the different options you have in this video tutorial!
    0:00 Why getting spreadsheet is relevant
    0:31 Spreadsheet vs. Sheet
    1:13 Getting a spreadsheet for a bound script
    7:05 getActiveSpreadsheet vs. getActiveSheet
    0:54 Getting a spreadsheet for a standalone script
    If you're interested in leveling up your Google Apps Script skill have a look at my online cours: https//courses.saperis.io
    #GoogleAppsScript #AppsScript #GoogleWorkspace #GoogleSheets #saperis #ChanelGreco
    -----
    saperis - Helping you become a Google Workspace Pro!
    Sign up to our TH-cam channel for more Google Workspace, Gmail, Google Apps Script, Google Drive, etc. videos: / saperis
    saperis website: saperis.io/
    saperis Linkedin: / saperis
    saperis Twitter: / saperis_io

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

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

    very very well done madame ..... i love this video ....many thanks 🌺 especially your correctness , spreadsheet versus sheet, i have searched for hours to get the only and one declaration, and how to work with it ....💐

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

      Most welcome 😊

  • @user-xg8ry2nl7k
    @user-xg8ry2nl7k ปีที่แล้ว

    The added insight about the infrastructure of the apps and how that affects the code makes all the difference between typing exactly as the example and being able to construct what I actually need. Thank you for thinking through what you are doing and what underlying information is needed by those just learning this tech.

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

      Thank you for the feedback. And yes, my videos are about handing you the tools so you can build your own awesome solutions.

    • @user-xg8ry2nl7k
      @user-xg8ry2nl7k ปีที่แล้ว

      @@saperis That is a common goal (I hope), I have found so few on-line classes and tutorials that come close to reaching it. Yours is one of them. I appreciate the answer back and what you are doing.

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

    holy moly!! I love you!! 🤣🤣🤣🤣
    Thank you!!

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

      Happy you like the video 😃

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

    Hello, you are making an amyzing tutorials with the best explanations I've found so far!
    I would like to ask you if u can make a video that explains how to make grafs from sheets to web(html document)?
    That's would be awesome!

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

      Thank you for watching our videos. I usually make videos on how to extend Sheets, Docs, etc. and don't touch on the subject of generating HTML. But you never know.

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

    Hello!
    Thanks for the great videos. I love the videos for their clarity and structure.
    I am stuck on a problem, maybe you can help me.
    I want to use a Google Forms query to ultimately get a properly (according to CI) formatted Google Sheet (Word) document.
    The data from Google Forms comes in in the active 1st sheet, but would then need to be formatted (second sheet) - So from DD.MM.YYYY to e.g. "Thursday, May 5".
    Which line do I have to rewrite to get the data not from the first (form responses) but from the 2nd sheet. (ARRAYFORMULAR I have used there)
    Thanks for your Answer!

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

      If the date is the only thing that needs formatting, how about applying a different date format to the original data?
      Otherwise I would suggest using the IMPORTRANGE Sheets formula and applying the necessary formatting on the second sheet. support.google.com/docs/answer/3093340?hl=en

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

    Thank you so much. I have learnt a lot from your vdos. By the way, what if I want to get access to the 2nd sheet in this example, i.e, 'The second' sheet? How to write the script?

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

      You have a couple of options: getSheetByName(name), getSheetById(), getSheets().
      Check these methods in the documentation to see which one suits your needs best: developers.google.com/apps-script/reference/spreadsheet/spreadsheet

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

    You explain these things so well. I've been working with Google App Script for a year and tend to copy and paste working code rather than understand what it's doing!! On a different note I'm trying to pull a couple of cells from a sheet via Slack but sending via a DM rather than a generic channel, any chance we can have a tuition video on that? :-)

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

      Happy you like the videos! And yes, it goes a long way to understand what all these different methods and functions actually do. 😀
      I try to make videos that will benefit as many as possible. That's why I try to explain basic concepts you will be using often.
      Your request is quite specific for your need and probably not something I will make a tutorial about.

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

      @@saperis Fair point about being very specific, I can't find any examples out there which does back that up!! I'll keep looking, thanks for the reply :-)

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

      I just stumbled over a blog post that might be useful: pulse.appsscript.info/p/2021/02/google-apps-scripts-libraries%e2%80%8a-%e2%80%8ahow-to-set-them-up-and-turn-slack-into-a-real-time-logging-platform/

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

      @@saperis And here's me thinking I've seen every Google result for GAS and Slack ;-) Not seen this one, thanks so much for sharing. :-)

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

      It was a lucky coincidence that I was looking at the GAS examples on Apps Script Pulse and remembered your request.
      They offer some cool tutorials there.

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

    Hi. This is the first of your videos I've watched. It's great how you explain stuff. I am a person with non coding background. Can you show me how to export Google Spreadsheet as a XLSX file at a specific location in Google Drive, or better off at a particular location on my computer. Thanks.

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

      You can only download a Google Sheets as an Excel file to your browsers "Download" folder: File > Download > Microsoft Excel.

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

      @@saperis That I know. But I need to do this via an Apps Script because of certain follow-ups involved wrt location and further actionable. Can you please help.

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

      @@arpitchokhani9903 Check this blog post to see how you can export a Sheet as an Excel file.
      Please note that with Apps Script you can only write documents to Google Drive. There is currently no way of accessing any location or folder on your computer.

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

    nice

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

      Thanks!

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

    Thank you for this video,
    How to access data on different Google Spreadsheet through Google Apps Script?

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

      There are multiple ways to open up another spreadsheet. One way would be by using the openById method (developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app#openbyidid).
      Check the official documentation to find the best method for your script.

    • @rt-uh6mt
      @rt-uh6mt ปีที่แล้ว

      @@saperis Such a simple thing but I found it really difficult to find this info as an app script noob. So either the script will be bound to that sheet or you can use openById. Great tutorial.

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

    Hy madame Chanel No. 1 ❤ the video is very good .... bbbbbbuuuuuut i have waited to the end to see how to open a standalone spreadsheet ... and not the first sheet, but the second or third ... 😢

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

      Thanks for watching 😃
      You might want to try out the getSheetByName method: developers.google.com/apps-script/reference/spreadsheet/spreadsheet#getsheetbynamename

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

      @@saperis I have 1000 reasons to love you 🌺 and this is one ... merci madame ....
      buttttttt 😵‍💫 this is the method when i am in the spreadsheet opened.
      I need the whole method ... for STANDALONE
      Open a spreadsheet ById and then Open a special sheet ByName .... in this spreadsheet
      i have to do this in my app i think a thousand times ...
      thanks a lot for your patience .... from now on ... i will collect roses for you 😍

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

    I’m trying to copy and paste in app script but for some reason it won’t let me paste what I have copied back into the ide on scripts

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

      Hi Karl. Make sure to use Chrome browser when working with the Google Apps Script IDE (Script Editor). Some browsers, like IE11, are known for not allowing copy & pasting code in the IDE.

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

      Nice. May this relate with apps script discussion th-cam.com/video/4BmgVzpctCM/w-d-xo.html

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

    I have 3 different sheets but I only want to run the script on one specific sheet. How do I do that?

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

      So, the question leaves many options open as it's not quite clear to me what you are trying to achieve. I'm guessing you have one spreadsheet and want to access the others sheets from that one. Correct?
      In that case check out the method openByUrl: developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app#openbyurlurl

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

    Great video but you made a typo with the timers, standalone scripts are at 8:54 not 0:54. Great content though

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

      Thanks for mentioning it. Sadly, once a video is up you can't change it anymore.

  • @mohamed.montaser
    @mohamed.montaser 3 ปีที่แล้ว

    how you don't have the new google apps script IDE

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

      Sadly, I have no way of speeding the rollout process up. Google has announced that the rollout will take longer than previously planned and will be finished in January 2021. 😒

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

    How can I create a New Spreadsheet ? (not a sheet)

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

      There's a create() method on the SpreadsheetApp.
      You can read about it here: developers.google.com/apps-script/reference/spreadsheet/spreadsheet-app#createname