CLASP Tutorial - Google Apps Script - How to Install CLASP

Sdílet
Vložit
  • čas přidán 19. 04. 2020
  • Learn how to setup CLASP to work with Google Apps Script projects locally.
    For more on this topic & help with installation check out & subscribe to my other channel:
    / @getitdonetube
    If you're already familiar with Node JS and Visual Studio Code environment, you can skip to 6:30.
    Links you may need:
    nodejs.org/
    code.visualstudio.com/
    github.com/google/clasp
    script.google.com/home/userse...
    #clasp #tutorial

Komentáře • 115

  • @apolovzla_ccs
    @apolovzla_ccs Před 4 lety +30

    I have to say, i have been following this buddy channel for a while and you helped me to make a way in the coding world. Bro, you deserve a place in heaven. Thanks a lot, no words to describe how useful are your videos and explanations...

    • @apolovzla_ccs
      @apolovzla_ccs Před 4 lety +1

      @HARIKRISHNAN R i can't believe what I've just read 🤣🤣🤣🤣🤣🤣 you have got to be kidding...

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 3 lety +1

      @@apolovzla_ccs Cool! Now this is what CZcams comments are supposed to be like! :)

  • @JillRhoads
    @JillRhoads Před rokem +2

    Even if I've done this before, I find myself coming back to this video to restart new projects! Thanks! Even after a year of programming with google sheets scripts...I am still coming back to this video to get new projects started. It's invaluable!

  • @fvgoya
    @fvgoya Před 4 lety +3

    Man!!!! This is extremely AWESOME!!!! Thank you very much to show it to us.

  • @AdamEfrati
    @AdamEfrati Před 3 lety +1

    Thank you, youtube finally decided to offer me this video of yours!
    Been thinking about something like that for a really long time!

  • @josephburwasser2729
    @josephburwasser2729 Před 4 lety +2

    You have the Best Spreadsheets Tutorials on the internet!!!! No exception here, thanks man!

  • @manuelavalos4578
    @manuelavalos4578 Před 3 lety +1

    This tutorial was awesome! Very clear and understandable!! You Rock!

  • @oraocean
    @oraocean Před 4 lety +2

    That's very nice and thoughtful of you to take care of both PC & MAC users! It's always fun to watch your video about google script.

  • @overdrivesystem2450
    @overdrivesystem2450 Před 4 lety +1

    Sir, this is something I always wanted to do.. thanks a lot! You're the best teacher I have ever found in youtube!

  • @rasdanc1
    @rasdanc1 Před 10 měsíci +1

    I'm so appreciative of this video... from setup to troubleshooting, I've relied on it a few times already, even until just earlier today

  • @allanregista4422
    @allanregista4422 Před 4 lety

    Liked it. Thanks again sifu. U're my savior, bro. For many times!!!!
    Please keep teaching us 🙏

  • @CanadianMang
    @CanadianMang Před 2 lety +1

    Amazing tutorial. Thank you so much. This is honestly like candy for my brain. I just get so excited learning this stuff knowing how much you can do with it.

  • @anthonysilvey3784
    @anthonysilvey3784 Před 4 lety

    Thank you for publishing this video!!!

  • @melfit9259
    @melfit9259 Před 3 lety +1

    Very helpful ! Once again ! Thanks !

  • @kafkareader3212
    @kafkareader3212 Před 4 lety +1

    Hello. You are the best, man. Thnx for your work.

  • @ericrobinson2590
    @ericrobinson2590 Před 2 lety

    Awesome tutorial. Thank you for making this.

  • @succeslotus
    @succeslotus Před 4 lety

    Great job! Excellent tutorials! 🙏

  • @Realmattvevo
    @Realmattvevo Před 4 lety +1

    Great!!! it's a very useful tool.

  • @IntrepidFox
    @IntrepidFox Před 4 lety +1

    Many many thanks for that!

  • @elricho72
    @elricho72 Před 2 lety

    GREAT Video, that's what I need, thank you 😀

  • @luciano073
    @luciano073 Před 4 lety +1

    Awesome!!!👍

  • @Traumatizes
    @Traumatizes Před 4 lety

    You, sir, have earned a subscriber.

  • @timsounds_
    @timsounds_ Před 4 lety +1

    Наконец то мою просьбу услышал =) Thank you

  • @maurofuzetto9141
    @maurofuzetto9141 Před 4 lety

    Man, você é o cara!

  • @nnij0
    @nnij0 Před 2 lety

    Amazing.

  • @rbsfinger
    @rbsfinger Před 2 lety +1

    Thank you!

  • @montecristobal
    @montecristobal Před 4 lety +2

    Great video as always. I just wanted to add that if you write a wrong line in your local file, it will be not uploaded in your remote repository after you do a clasp pull.

  • @heliogomesmagalhaes
    @heliogomesmagalhaes Před 4 lety

    Awesome video as usual!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      Glad you enjoyed it!

    • @heliogomesmagalhaes
      @heliogomesmagalhaes Před 4 lety

      @@ExcelGoogleSheets All the steps worked fine for me. I tried to create subfolders in src folder to have a more organized project files, but when importing another project, it says "No valid .clasp.json project file. You may need to 'create' or 'clone' a project first". I saw on github they allow one file per project, but when trying to modify this file to import another one, it fails.
      My suggestion: make another video showing how to clone multiples projects id's; does Visual Studio support the 'working with Libraries in Google IDE'?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety +1

      You need to create a new folder separate from the old one and repeat the same steps. Don't add multiple projects within that same folder.

    • @heliogomesmagalhaes
      @heliogomesmagalhaes Před 4 lety +1

      @@ExcelGoogleSheets It worked! Great! Thank you so much! But it's a 'bad' thing, because I'll have separate folders to pull/push with clasp. All this because for a big project with GAS I usually create several files for a better organization. But if i put all my .gs files in one google file using this notation 'folder1/fileA' , 'folder2/fileB', and so on, clasp will create folders 'folder1' and 'folder2' with their respective files in one project folder (as written on github description), then I'll have only one project to push/pull. That would be a lot of files .gs in one google alps scrpit file, but if I am using clasp, it's because I want a better IDE.

  • @ogcombatacademy
    @ogcombatacademy Před 4 lety +1

    Thanks for this

  • @ZealPlex
    @ZealPlex Před 4 lety

    Nice video keep uploading

  • @zafaraeqbal
    @zafaraeqbal Před 4 lety

    Thanks a lot.

  • @fvgoya
    @fvgoya Před 4 lety

    please, more videos about clasp!

  • @adilshoukat
    @adilshoukat Před 2 lety

    Thanks for the step-by-step tutorial.
    The only benefit of using CLASP over the default online IDE is the debugger. The debugger of the default IDE really sucks. You cannot add custom variables to watch. Which wastes a lot of time. Because you have to drill down to the specific index of arrays to see the values. The other option is to use Logger, which also is a time wasting technique.
    So, in my opinion using Visual Studio Code debugger is the only benefit of doing all this. If you would have covered the debugger in this video as well, that would be really good.

  • @IanCrawfordBrunt
    @IanCrawfordBrunt Před 4 lety

    Thank you

  • @some-thing-2024
    @some-thing-2024 Před 4 lety +1

    How about debug, can create subfolder contain file .cs , .html

  • @igoshin
    @igoshin Před 4 lety +1

    Thank you for lesson. Can I run the debugger in Visual Studio Code? Or CLASP needed only for writing code, and the debugger run only in the browser?

  • @ep302
    @ep302 Před 4 lety

    quick question: when we do clasp push (it looks like git push), does that push the local code into the 'master' branch (i.e. GAS) directly or is it first stored into an intermediary clasp server? i'm thinking security, and if this is safe in the context of developing enterprise or client code

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety +1

      It goes to GAS directly, but it doesn't get deployed. So your latest deployed version of the web app will remain the same. Your dev version will change.
      If you want to do version control you should still be using git in addition to this, because Apps Script doesn't have a good version control.

  • @WasanKhunnadiloksawet
    @WasanKhunnadiloksawet Před 4 lety +9

    Master, want to learn about using OAuth2.0 with Apps Script.

  • @yunyiwei5508
    @yunyiwei5508 Před 4 lety

    thanks for the video. I have an issue with the getRange. It seems that after I push the modification on googlescript, it can not identifier which getRange I used (since there are 5 types). It may be my mistake to not write it correctly at VS also (new player on it)... thanks

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      I don't understand. What's the code you wrote?

    • @yunyiwei5508
      @yunyiwei5508 Před 4 lety

      @@ExcelGoogleSheets I write down the getRange commander at VS and after I push to Google sheet, it seems it doesn't pass with some reason. I have to erase it and rewrite the comande lien at Google sheets. Thanks

  • @Shkur777
    @Shkur777 Před 4 lety

    👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻👍🏻

  • @efara
    @efara Před 3 lety

    I will definetely try it, but when we talk about deployment does it support frameworks or libraries on the server side?

  • @adrianobalduino3850
    @adrianobalduino3850 Před 4 lety

    very nice! I was able to use CLASP on windows in cmd but not in VS code. Is there a way to open the terminal in VS code on windows as Admin as you did on Mac?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      It sounds like you forgot to push the changes. Dev should work just fine. Just setup "clasp push -w" and you should be fine.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      Also make sure you get the latest dev link.

    • @joseolivares4629
      @joseolivares4629 Před 4 lety +1

      Open VS as Admin (This should open the terminal as admin too).
      If you get an error like "execution script are not enabled"... or something like that. Open PowerShell (As Admin) and paste this command: "Set-ExecutionPolicy Unrestricted". Type "S", and everything should be fine now (i hope).
      edit: (All this done on win10)

  • @christopherlawes9286
    @christopherlawes9286 Před 4 lety

    This seems promising. Is it possible to see result of code from VS Code in browser (using live view or similar) as it would appear on google server? If so, does this work using the "" style? Google js file is js.html so might not work?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      The easiest thing to do is to open Web App dev link in your browser and setup clasp push --watch. This way all changes you make are automatically applied on the server, so you can just work as usual but use your editor instead of web editor.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      You are still going to be writing exactly the same code.

  • @darilrahmatullah4161
    @darilrahmatullah4161 Před 2 lety

    just in case, someone might want to check stackoverflow for this issue “execution of scripts is disabled on this system.” if your vm running in windows 10.

  • @davidsrz
    @davidsrz Před 3 lety

    how can I require/import a file ? will have the same behavior?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 3 lety

      You can't require is apps script.
      You can however use import/export and compile it to a javascript file. I have examples of doing that on my other channel if you check under about section.

  • @0ox3r0xo0
    @0ox3r0xo0 Před 2 lety

    Hi friend, I did everything what you told but for the code autocompletion and methods information(intellisense), I cant see on visual studio code, do you know why?
    Edit: Fixed, you have to create a file named jsconfig.json on the root folder(where your .clasp.json is) and put the below:
    {
    "compilerOptions": {
    "target": "es5",
    "module": "commonjs"
    },
    "exclude": [
    "node_modules"
    ]
    }

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 2 lety

      Usualy, just closing an reopening VSCODE solves this problem.

  • @IM1THE2KING3
    @IM1THE2KING3 Před 4 lety

    #StaySafeStayHome

  • @mansaha9288
    @mansaha9288 Před 4 lety +2

    The follow-up could be vuejs on gas.

  • @mattbarden8330
    @mattbarden8330 Před 3 lety

    This is awesome. The only thing not working is the autopopulate for metas - I've got the latest clasp version, but when I run the second command, nothing happens. anyone having the same issue?

    • @valentinsarmagal
      @valentinsarmagal Před 3 lety

      as far as I can tell, you need to run the npm i -S @types/google-apps-script command in the root folder for each project you make ¯\_(ツ)_/¯

  • @romeond
    @romeond Před 4 lety

    I am wondering how to use Logger when I run code in Visual Studio Code?!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety +1

      Logger is not available. you can setup console.log to work and use "clasp logs" github.com/google/clasp#logs. There are some other consequences when you do this setup, so do it on a test project first.

  • @christopherjspiteri
    @christopherjspiteri Před 4 lety

    Got to cloning part and nothing happens. I end up with the > prompt. I have tried this in the VSCODE terminal and the terminal on my computer.
    any help appreciated
    EDIT - I went to the github commands reference and cloned using the URL rather than the project ID.
    - I still would like to know why the other way did not work.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      Maybe check this video for installation instructions czcams.com/video/4UYe5aMHXfs/video.html

  • @tonym2540
    @tonym2540 Před 4 lety

    Is there a way to run the code (to test it) using Clasp on your local computer? Or do you have to always use the google browser interface to run code?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety +1

      There is one, but I don't find it particularly useful. It also requires you to port your project to self managed project in order to be able to run the functions. Once you port there is no way back.

    • @tonym2540
      @tonym2540 Před 4 lety

      ​@@ExcelGoogleSheets I asked because my interest in Clasp was to work more "off-line" to avoid the interruption to my coding workflow that happens when my internet drops at times. But if I can't run the code to test it, I don't see why Clasp would help me. Still, your instructions are great.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety +1

      Running functions is not going to work offline.

  • @robertoculiersi3284
    @robertoculiersi3284 Před 4 lety

    Anybody knows why clasp -v doesn't show me the version (it seems it doesn't run the program) meanwhile if I write clasp -v on the command prompt it works? (On visual studio I get FullyQualifiedErrorId : UnauthorizedAccess) (I've windows 10).
    Your tutorial are the best! keep it up!

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      Try this www.donovanbrown.com/post/Using-PowerShell-in-VS-Code

    • @robertoculiersi3284
      @robertoculiersi3284 Před 4 lety

      ​@@ExcelGoogleSheets thanks for your fast answers! You're very kind. Actually I've solve the problem following this link: stackoverflow.com/questions/56199111/visual-studio-code-cmd-error-cannot-be-loaded-because-running-scripts-is-disabl . I think it's the same solution. I share that for everyone that has similar issue.
      I'm always waiting for your next video! Bye

  • @explainspragmaticworks8477
    @explainspragmaticworks8477 Před 11 měsíci

    Google Sheets Script editor?

  • @francismata4492
    @francismata4492 Před 4 lety

    all of your tutorials code are available to patrion?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      I want to do it starting next month. Do you know a good place/way to host this type of thing?

  • @Timogavk
    @Timogavk Před 4 lety

    What about debugging?

  • @adrianobalduino3850
    @adrianobalduino3850 Před 4 lety

    I tried to use this solution on web Apps but everytime I push data to Google Apps Script I have to deploy the app for being able to test it. Is there a way to use the dev option to test the latest code using CLASP?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      Are you not able to do all the other commands other than installation?
      Did you try? What message do you get?

  • @redbeard1891
    @redbeard1891 Před 4 lety

    I wish we could use vscodes debuger :(

  • @khalidelshehaly3273
    @khalidelshehaly3273 Před 3 lety

    Can we create css files then upload them like .html files ?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 3 lety

      You can make it work that way. Learn more on my other channel czcams.com/channels/JebzvfCuA5ymtb79DQm36A.htmlvideos

  • @aldolunabueno2634
    @aldolunabueno2634 Před rokem

    11:51 First commands

  • @vugpgu
    @vugpgu Před rokem

    Без відладки сенсу немає. Здається є можливість налаштувати авторизацію через OAuth2, але якось напряжно

  • @ruzaqir354
    @ruzaqir354 Před 4 lety

    i have a problem when i clasp clone it said couldnt find script

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety

      Check the script id

    • @ruzaqir354
      @ruzaqir354 Před 4 lety

      @@ExcelGoogleSheets lol it's not the script id. I put space in root Dir. Thx man for replying

  • @WasanKhunnadiloksawet
    @WasanKhunnadiloksawet Před 4 lety +1

    Success in stall clasp on Linux Mint but fail on "clasp -v" . Can not call program clasp.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety +2

      Try
      sudo apt-get update -y
      sudo apt-get install -y clasp
      and then check again

    • @WasanKhunnadiloksawet
      @WasanKhunnadiloksawet Před 4 lety +1

      @@ExcelGoogleSheets Thanks, Succcess by installing new NodeJS. but stuck with the last step, autocomplete does not work.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  Před 4 lety +1

      When you open package.json file does it include "dependencies": {
      "@types/google-apps-script": ?

    • @WasanKhunnadiloksawet
      @WasanKhunnadiloksawet Před 4 lety +1

      @@ExcelGoogleSheets
      It appear like this.
      "dependencies": {
      "@types/google-apps-script": "^1.0.12"
      }

    • @WasanKhunnadiloksawet
      @WasanKhunnadiloksawet Před 4 lety +1

      @@ExcelGoogleSheets Today autocomplete can work without doing anything. Maybe only restart Visual Studio. Thanks for your caring