Google Apps Script - Google Drive Tutorial, Files, Folders, Copy Files, DriveApp, Iterator - Part 15

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ธ.ค. 2024

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

  • @tomsawkins9828
    @tomsawkins9828 5 ปีที่แล้ว +7

    just spent 2hrs turning this into something i wanted for ages - once again thanks very much for these videos

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

    Just one word for this video!! WOW!!! Really apps scripts is wonderful tool for management

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

    this is on another level - GOD BLESS YOU!!!!!!!!!!

  • @Benji-Hello-World
    @Benji-Hello-World 4 ปีที่แล้ว +1

    Great videos the best for Google SpreadsheetApp learning

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

    Damn! It's always a great pleasure learning with your videos. This is a new topic for me and i'm very happy to find you having it covered!

  • @catnop1912
    @catnop1912 6 ปีที่แล้ว

    You are a hero...We love you man !!!

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

    Super video and very easy to follow

  • @kshitijpandey3290
    @kshitijpandey3290 4 ปีที่แล้ว +10

    could you do a quick video on how to upload a file (image maybe) using App Script from a Web App?

  • @Guillute
    @Guillute 5 ปีที่แล้ว

    Very few views. I'm glad to be a nerd learning things. Thanks for the video. It is gonna help me on a project I'm working on

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

    interesting explanation!!!

  • @sanjay.bhatnagar
    @sanjay.bhatnagar 7 ปีที่แล้ว

    Great piece of teaching!

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

    Thanks for this tutorial!!

  • @RahulSharma-uj7cr
    @RahulSharma-uj7cr 3 ปีที่แล้ว +1

    Great tutorial as usual. please share more videos on google sheet and drive app together.

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

    Great video

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

    Beautiful! Thank you for this!

  • @ge2893
    @ge2893 3 หลายเดือนก่อน

    You are awesome thank you!

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

    Great. Thank you.

  • @freshbreeze6180
    @freshbreeze6180 4 ปีที่แล้ว

    This is awesome.

  • @fredericocardosostein8008
    @fredericocardosostein8008 4 ปีที่แล้ว

    Great, very useful video! Thank you

  • @geremycao4919
    @geremycao4919 5 ปีที่แล้ว

    Awesome Video

  • @muradelvis5267
    @muradelvis5267 5 ปีที่แล้ว

    Thank you. Could you tell me please what screen recorder you use for making your videos in that high quality?

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

    this guy is fabulous, it will be good if he live neighborhood.

  • @prakashchaudhary839
    @prakashchaudhary839 7 ปีที่แล้ว

    Thank you so much for your all efforts
    Sir Please upload daily videos

    • @nsewin
      @nsewin 7 ปีที่แล้ว

      sir when i use this in sheet using retrun method showing me error message "you dont have permission to getfolderbyId" kindly guide how to solve this

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

    Amazing video I just want to ask that I have a folder in google drive and a sheet in it by using this method how can I add data of that sheet in my current spreadsheet

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

    thumbs up for this! thank you.

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

    Thank you

  • @programador1972
    @programador1972 7 ปีที่แล้ว

    Thank you, good script

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

    Hello, would you like to use api for the following:
    I have a wordpress site, I put files for download, I put the link to my google drive, the user clicks on the link and this file is added to his account? Thanks

  • @Benji-Hello-World
    @Benji-Hello-World 4 ปีที่แล้ว +1

    "if you don't know what you're doing" haha yep good advice

  • @PriscillaSecret
    @PriscillaSecret 5 ปีที่แล้ว

    Thanks for the video

  • @bensonchen8346
    @bensonchen8346 5 ปีที่แล้ว

    thanks for the video!

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

    Thanks

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

    Great stuff. I'm looking for a way to watch a folder and (if) someone, in our organization) uploads a file there in that folder then I get a flagged cell in Spreadsheets or a message/email/hangout anything. We have thousands of NULL folders and it's time consuming to constantly chase people or manually go through the folders to see if team members have sent in requested files. P.S. most of these people work in construction so aren't going to have time to link drive files and send emails.

  • @davidduran2984
    @davidduran2984 4 ปีที่แล้ว +3

    Hi all. It might be worth pointing out that sometimes you can't see the results in the folders right away. I ran the script without issues yesterday but the small and large folders appeared to be empty. When I checked out the folders today to tinker the script I noticed that the files were copied were they belong. I suppose it might have something to do with my bandwidth.

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

    Hi, can you tell us about continuationtoken when folder with subfolders are need to be scaned for files?

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

    Hi... i'm not a seasoned code writer so please understand if my question is too basic. Could you let me know how to select specific file names within the Drive folder. I'm trying to automate moving files that contain the text "Notes" from one folder to another. I figured out how to move the file; just can get how to select the file(s)

  • @gracielaruiz9325
    @gracielaruiz9325 4 ปีที่แล้ว

    On my code the line: var folder = folderIter.next(); it's getting me this error message: [20-06-17 09:20:21:049 CDT] TypeError: folderIter.next is not a function
    at moveFiles(Test 3:5:27)
    . Would it be because I don't have any files? I am trying to get the files submitted from a Form to a specific folder. The Form automatically sends the files to a particular folder but I need these files to land in a created folder name which the code has been written to create folder if specific information is selected and the folder creation works. All I need is to move the files to the created folders. Can anyone help? Thanks!

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

    How can I take a set of images from a google drive folder, like you're doing here, and automatically make a Google slides out of them?

  • @AlexanderAbramovNN
    @AlexanderAbramovNN 7 ปีที่แล้ว

    Thank you! Please make a lesson about the input data (external web form )?

  • @DavidMermelstein
    @DavidMermelstein 7 ปีที่แล้ว

    Good job. I enjoy your videos. Now that it is done, does the script run automatically when add a photo to that folder?

  • @BenniK88
    @BenniK88 4 ปีที่แล้ว

    Awesome tutorial. How could I insert the found pictures into the cells with the made while loop?

  • @mohammedal-momin6075
    @mohammedal-momin6075 4 ปีที่แล้ว

    Hi, I have some files attached to a google sheet, and there is a column for files url in the sheet. I need to extract the names of these files into a separate column in the sheet. Any help will be appreciated.

  • @Zhurak
    @Zhurak 4 ปีที่แล้ว

    so you added the file names to the spreadsheet but how do you actually add the image itself to the cell.

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

    Hello, How to convert photos to OCR as a group using Google Drive? because only one photo is converted to text at each step (through conversion by Google Doc).

  • @soham-dalvi
    @soham-dalvi 4 ปีที่แล้ว

    Hi Thanks for all your videos, very useful. One use case I could not find in your videos is to upload a file to google drive from GAS web application. if it's already available please point me to it OR it will be very helpful if you could add it. Thanks.

  • @lazalazarevic6192
    @lazalazarevic6192 5 ปีที่แล้ว

    Hi again. Was wondering if it is possible to make an App Script macro in Google sheets to extract the list of folders/sub-folders (tree) and also a list of people that they are shared with, their access level... Or just point me in the right direction. Many thanks

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  5 ปีที่แล้ว

      access to what? folders, files in folders?

    • @lazalazarevic6192
      @lazalazarevic6192 5 ปีที่แล้ว

      @@ExcelGoogleSheets Yes! Some script that would pull the metadata. For start, it would be useful to have an input field for entering the link to the folder and then the script runs and returns a table with all the metadata. Is that even possible?

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

      It should be possible, not saying it will be easy though. This may require recursion if you don't have limited level of folder depth in mind, which is a difficult subject on its own. Additionally, I'm not sure how you would get those results in a table, because depending on how many folders you have and the number of folders & files in each folder, this table can get enormously large. But in short you would need one function that gets you folders in a folder, and then recursively call that same function on all folders. I'm not sure whether Google has limit on recursive call stack. Old javascript version does, which Apps Script seems to be using, but then it's a modified version of it, so who knows. You'll have to try and see. I'd say search "javascript recursion" and see if you can wrap your head around it.

  • @passangtsheringtamang5685
    @passangtsheringtamang5685 4 ปีที่แล้ว

    It would very much help if could make video regarding file upload to the google drive folder with help of apps script.

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

    🙏🏻

  • @LaurivaldoLopes
    @LaurivaldoLopes 4 ปีที่แล้ว

    can I increase or program a minimum access limit?

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

    Thanks Sir, how to reduce that file size suppose I upload an image with size 5 MB and I want to reduce it to 500 KB ?

  • @lastmonsta
    @lastmonsta 6 ปีที่แล้ว

    Thank you for the vide, this helped me out so much. I do have a question, which I hope you can answer. I have Google advance drive enabled on v2 as I am trying to disable users from being able to download my files. The following code fails stating that my filename which is shown and correct cannot be found:
    ----
    var filename = file.getName();
    var labels = {
    'labels': {restricted: true}
    };

    Drive.Files.update(labels, filename);
    -----
    Any advice would be so helpful.

  • @athandiwencukana6431
    @athandiwencukana6431 4 ปีที่แล้ว

    Hi
    Nice video as usual, Is there a way that i can move files from my Drive to Team drive folder?

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

    How would u add video files to a spreadsheet?

  • @tupushaka9539
    @tupushaka9539 5 ปีที่แล้ว

    Hi, I'm searching how to automatically store gmail attachments into specific google drive folder and then overwrite the same file with the same name. Would you mind to make the script tutorial? I've been searching here and there but found no result. Thank you very much for your attention.

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

    Great video, I am trying to do the same but for over 20K images, it is very slow while looping through all those images. Do you have any suggestions to follow for large amount of images? thanks! : )

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

      I'm not sure exactly what you're trying to do with your files. Using something like Google Colab may help, but again, depends on many factors here.

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

    Yep.

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

    Thank you very much. How do I open a file using google apps script?

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

    Hi
    I tried to upload a file using the Firefox browser.
    But, the file is not uploaded correctly.
    can you help me -please?

  • @MichaelDaniels
    @MichaelDaniels 5 ปีที่แล้ว

    Can we get files from a shared with me folder?

  • @marlonvelezrocha9128
    @marlonvelezrocha9128 4 ปีที่แล้ว

    Can you help me, I can not find how to do it, I am starting in KODULAR, how can I get DWG files (Autocad) or JPG files from GOOGLE DRIVE and download them to the cell phone by pressing a button in the application, thank you very much.

  • @MichaelDaniels
    @MichaelDaniels 5 ปีที่แล้ว

    Is there a way to add a file name in a cell? For example I open a file and I want that file name in cell a1

  • @akeelabtan8606
    @akeelabtan8606 4 ปีที่แล้ว

    Hi, how we can create a sheet inside a spacial folder using Google Apps Script?

  • @imtiazali1628
    @imtiazali1628 5 ปีที่แล้ว

    Dear i tried to find files contains sepcific word . it works fine with root folder but if i try in subfolder its not working. Will you please guide further. thanks.

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

    How can I add a new row in Google spread sheet when I Add a new folder inside parent folder

  • @7BoldIdeas
    @7BoldIdeas 4 ปีที่แล้ว

    How can I use a function from the different google script file in the same project or may be in a different project ?
    Please help !
    I guess ScriptApp can be used. But i didn't find anything . If you are not free enough to do a video. Just share link or anything. That might help !

  • @direcciondeformacionintegr2134
    @direcciondeformacionintegr2134 5 ปีที่แล้ว

    This function works well from the console but from a document, the call to Driveapp... does not work, why? What's left to define? SORRY FOR MY ENGLISH

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

    it would be super awesome if we could automatically(once per day) save folders from Goggle drive to our pc and then delete them

  • @halee2124
    @halee2124 5 ปีที่แล้ว

    can you please show how you can upload files from a web app and into a google sheet?

  • @FardinSadeghi
    @FardinSadeghi 4 ปีที่แล้ว

    another question: can you access the hard drive files rather than Google Drive?

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

      Not using Google Scripts. Use NodeJS or Python instead.

  • @VirendraBG
    @VirendraBG 4 ปีที่แล้ว

    How to hire you for Google app script assignment?

  • @glistenlegal5186
    @glistenlegal5186 4 ปีที่แล้ว

    Sir please make a video how to automatically rename a file uploaded in Google form based on fields in Google form

  • @FardinSadeghi
    @FardinSadeghi 4 ปีที่แล้ว

    Is it possible to with app script to change the photo names?

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 ปีที่แล้ว

      Sure

    • @FardinSadeghi
      @FardinSadeghi 4 ปีที่แล้ว

      @@ExcelGoogleSheets Would it be setName instead of getName? Any hint would be great!

  • @ZaidZaid-nh5kv
    @ZaidZaid-nh5kv 4 ปีที่แล้ว

    How we contact you if face problems sir

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

    How can we create folder to user login then create folder then select that, pls help. im subs btw, thank you!

  • @tomsawkins9828
    @tomsawkins9828 5 ปีที่แล้ว

    Code seems to run perfectly for me but when shared it returns "Cannot retrieve the next object: iterator has reached the end" - Only occurs with people i have shared file with
    . Hoping for a quick solution. thanks

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  5 ปีที่แล้ว

      it's using driveapp and other users probably don't have permission to access the folder in google drive.

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  5 ปีที่แล้ว

      You'll need to share the folder as well.

  • @asifpaLash
    @asifpaLash 4 ปีที่แล้ว

    how to uplaod a file to my drive folder by ID?

  • @belochmek
    @belochmek 5 ปีที่แล้ว

    Hey I like your videos, I'm working on a script but I can't get it to work properly, I have tried some sample code and modified it. I want to copy sheet to a new sheet in my database log, however i don't want to bring every formula just the fixed values when my script runs. If its possible, what do I need to change in the formula? the comment on top is using contentsOnly:true but when i use it dos not work. Thanks alot
    // var targetSheet = ss.getSheetByName("CLOSED");
    // var target = targetSheet.getRange(targetSheet.getLastRow() + 1, 1);
    // s.getRange(row, 1, 1, numColumns).copyTo(target, {contentsOnly: true});
    // s.deleteRow(row);
    function onOpen() {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var pasteSheet = [ {name: "Paste Sheet", functionName: "copySheet"}];
    ss.addMenu("Copy to Spreadsheets", pasteSheet);
    }
    function copySheet() {
    var source = SpreadsheetApp.getActiveSpreadsheet();
    var sheet = source.getSheets()[0];
    var sourceFile = DriveApp.getFileById(source.getId());
    var sourceFolder = sourceFile.getParents().next();
    var folderFiles = sourceFolder.getFiles();
    var thisFile;
    var date = Utilities.formatDate(new Date(), "GMT+1", "dd/MM/yyyy");
    var endDate = date;
    while (folderFiles.hasNext()) {
    thisFile = folderFiles.next();
    if (thisFile.getName() !== sourceFile.getName()){
    var currentSS = SpreadsheetApp.openById(thisFile.getId());
    sheet.copyTo(currentSS);
    currentSS.getSheets()[currentSS.getSheets().length-1].setName('THIS WAS COPIED'+" "+endDate);
    }
    };
    }
    The plan is to run this every day and make a daily copy at the same time then be able to analyze the change in data.

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

    how can i insert images in cells using this script

  • @estonhumphrey2911
    @estonhumphrey2911 6 ปีที่แล้ว

    Is there a book that I can learn all this in?

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

    How to download this file present in Google Drive folder through the app script?

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

      The short answer: you can't because Apps Script runs on the server.
      It's possible with Google Drive API and Node or other programming environment.

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

    How to get files URL next to the file name?

  • @koungsareth8623
    @koungsareth8623 4 ปีที่แล้ว

    Hi !
    My name SARETH, I would like to request help. By using Google sheet as database.
    1- How to use app script to automatically create google sheet files in particular folder and base on the name ? For example, we want to create Travel Authorization for 40 people only one time and all information containe in the sheet the same but separated files.
    2- I want to create Vehicle fleet management system and the system can produce monthly report. In the report containes about: Vehicle ID, DATE of filling fuel, Odometer start, Odometer end, Projects, distance which used for each project.
    Many thanks for your help

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

    I Want to segeregate MY ilages stylcode wise Folders

  • @deepukathait6916
    @deepukathait6916 4 ปีที่แล้ว

    How to get photos from google photos plz help

  • @asyikbrowsing200
    @asyikbrowsing200 4 ปีที่แล้ว

    How to get folder list with folder name or folder id?
    I want to get all folder from root and sub folder..

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 ปีที่แล้ว

      The short answer is, use recursion

    • @asyikbrowsing200
      @asyikbrowsing200 4 ปีที่แล้ว

      @@ExcelGoogleSheets I searched on google related to this and did not find it until now. Can you share the code, sir?

    • @asyikbrowsing200
      @asyikbrowsing200 4 ปีที่แล้ว

      I found this www.labnol.org/code/19923-google-drive-files-list, but the coding seems to be showing not only folders but files

    • @asyikbrowsing200
      @asyikbrowsing200 4 ปีที่แล้ว

      @@ExcelGoogleSheets For simplicity, I want to get jpg files in the root folder and subfolders without defining the folder name or folder id

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  4 ปีที่แล้ว

      I thought you wanted the folder? Or do you just need the JPG files?

  • @MichaelDaniels
    @MichaelDaniels 5 ปีที่แล้ว

    Is there a way to copy my sheet as a pdf to a dropbox folder? What if the dropbox file is different from computer to computer? Or maybe if there is a folder with the name in cell A1 save it to that folder, if not save it to a new folder with the name in A1. Is something like this even possible? thank you

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

    folderIter.next isn't a function anymore

  • @lordhriley
    @lordhriley 4 ปีที่แล้ว

    Shit, can we do the same thing in google drive with Python?

  • @ZaidZaid-nh5kv
    @ZaidZaid-nh5kv 4 ปีที่แล้ว

    Sir we need to send direct link but we can't .

  • @ryanherter5873
    @ryanherter5873 6 ปีที่แล้ว

    how do I .getFolderById

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

    Could have done without the while loop explanation.

  • @Mahmoudalgindy
    @Mahmoudalgindy 6 ปีที่แล้ว

    Thanks so much, can someone paste the code here!

  • @Barxxo
    @Barxxo 6 ปีที่แล้ว

    fucking curly brackets.. i hate them...
    but thanks anyway for explaining :-)

    • @ExcelGoogleSheets
      @ExcelGoogleSheets  6 ปีที่แล้ว

      lol, if you hate curly brackets so much you should probably stay away from programming. Well, I guess you could program in Python, no curly brackets there ;)