How to Automatically Share on Google Drive With Google Apps Script

Sdílet
Vložit
  • čas přidán 29. 08. 2024

Komentáře • 63

  • @DigitalInsidersShop
    @DigitalInsidersShop Před 14 dny

    Very helpful! Thank you so much!

  • @TMCI-education
    @TMCI-education Před 7 měsíci

    Your work is amazing! In building upon the tutorial, is there a way to use Google Forms so people can submit their email on google forms, saved to google sheet, then allow them to automatically have access to a specific file, which you have set?

    • @saperis
      @saperis  Před 7 měsíci

      Yes, you can create an Apps Script project to do that.

  • @harithrani5929
    @harithrani5929 Před 2 lety

    Very neat. The teaching style is precious. Lovin it.

  • @canadasmartmind
    @canadasmartmind Před 2 lety

    Thanks ! This is what I've been looking for. Thank you!
    Great video. Keep flowing your word.

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

      Happy to hear this video was useful!

    • @canadasmartmind
      @canadasmartmind Před 2 lety

      Hi Jane. Thanks a lot. this video solves my problem. I have no experience whatsoever in scrips. I just code it now and works fine. Awesome!

  • @RahulGupta-bn4rj
    @RahulGupta-bn4rj Před rokem

    excellent video, it would help , i request you to make videos on some more advance functionality with google app script

    • @saperis
      @saperis  Před rokem

      I don't make any Apps Script videos on this channel anymore.

  • @EderRamosHenriquez
    @EderRamosHenriquez Před 4 dny

    Can somebody confirm if there any way to not send the notification via email when we share the file via script?

  • @aliciachin5260
    @aliciachin5260 Před rokem +1

    What's the reason for using const instead of var in this case?

    • @saperis
      @saperis  Před rokem

      Check this video to see the difference between const and var: czcams.com/video/x3xZXJmb05U/video.html

  • @ruangbelajarkuclub
    @ruangbelajarkuclub Před rokem

    Thanks for explain this video.. can you make video share automate file to whatsapp using google appscript. Thanks before

    • @saperis
      @saperis  Před rokem +1

      We do not do any Apps Script videos on this channel anymore.

  • @anthonyescribens
    @anthonyescribens Před 2 lety

    Awesome! Thank you.

  • @nnekao6563
    @nnekao6563 Před 2 lety

    Very helpful video. Question for you: When sharing can you also add a custom message?

    • @saperis
      @saperis  Před 2 lety

      The methods to set permissions don't accept a message. You would have to expand the script to send those people a message through Gmail.

  • @user-qh2lk9xx4p
    @user-qh2lk9xx4p Před 2 měsíci

    hello i want to put message in it too! how i can do it??

  • @Leover378
    @Leover378 Před 2 lety

    Muy buen video. Nuevo suscriptor.

    • @saperis
      @saperis  Před 2 lety

      Gracias! Me alegra que te ha gustado este video. Tenemos muchos otro videos para aprender Google Apps Script.

  • @user-dy1zx5zm7l
    @user-dy1zx5zm7l Před rokem

    Your video is very helpful. But I don't want to send the file sharing notification to these objects. Can you guide me?

    • @saperis
      @saperis  Před rokem

      Are you sure a notification is sent? The documentation doesn't mention anything about a notification being sent: developers.google.com/apps-script/reference/drive/file#addvieweremailaddress

    • @user-dy1zx5zm7l
      @user-dy1zx5zm7l Před rokem

      @@saperis No. don't want to send notifications to the person being shared.
      Because by default of google driver, if I add any person with any permissions, Driver will send a message to the shared person.

  • @ConanEdogawa24710
    @ConanEdogawa24710 Před 2 lety

    Hi I like how you explain things in your videos. Can you make a video about PMT function? I have a hard time understanding that function Please and Thank You!.

    • @saperis
      @saperis  Před 2 lety

      What's a 'PMT function'?

    • @ConanEdogawa24710
      @ConanEdogawa24710 Před 2 lety

      @@saperis
      Well, all I understand from it is that, its helpful when you are buying a house or a car. The formula is =PMT (rate, number_of_ periods, present_value, future_value).

    • @saperis
      @saperis  Před 2 lety

      @@ConanEdogawa24710 Well, I have no clue of that PMT formula so I better stick to making videos about things I have knowledge about: Google Workspace and Google Apps Script. 😀

  • @AmmarMerhbi77
    @AmmarMerhbi77 Před 2 lety

    Great video. What if one wants to share one file with multiple emails. Can it be customized for comma separated emails?
    What about unsharing?

    • @saperis
      @saperis  Před 2 lety

      Yeah, I guess you could adapt the code as to have all emails in an array and then probably use REGEX to identify the separate email addresses. REGEX is not my forte so I personally wouldn't want to use that method.
      There are methods for removing access to files. Check here: developers.google.com/apps-script/reference/drive/file#removeEditor(String)

  • @hindont
    @hindont Před rokem

    Great video. What if I want to share a folder?

    • @saperis
      @saperis  Před rokem

      If you want to share a folder I suggest you check the documentation. Like that you'll find out how you can share a folder: developers.google.com/apps-script/reference/drive/folder

  • @ralphjosephmarifrilles1604

    Hi Saperis good day! It is posible to print a pdf file on google drive using apps script.

    • @saperis
      @saperis  Před rokem

      No, you can't print a PDF. But you can export a file and save to Google Drive as a PDF: czcams.com/video/xUovS4fwqsg/video.html

  • @canadasmartmind
    @canadasmartmind Před 2 lety

    Hi Jane. Is it possible to automatically, via code, not send a Notification to the person I share my Google doc with?
    I have successfully used your code shown in this video.
    Thank you, Saperis.

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

      The script in this tutorial doesn't send out any notifications to the person you are sharing the file with.

    • @canadasmartmind
      @canadasmartmind Před 2 lety

      @@saperis Ok, Helen.
      Thanks!

    • @dyobetem
      @dyobetem Před 2 lety

      actually it sends a notification on their end.

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

      @saperis it does send out notification, how do we disable that?

  • @InspireForex
    @InspireForex Před 2 lety

    This is an amazing Video. I really needed very much this script. Now I am only stacked in two steps.
    1- is an error related to emailAndPermissions.forEach ... It says it is not a function. I changed it to array.from(emailAndPermissions).forEach and it seems to work but
    2- When I run the script it continues to give me the Alert message " Permissions must be.... etc, etc" in the sheet. It seems like a loop. Every time I click 'ok' it reappears.
    Can you please help?

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

      I would suggest you stick to the script I wrote. The error message about the permissions is trying to tell you that you are using the method and passing in the correct parameters.

    • @InspireForex
      @InspireForex Před 2 lety

      Saperis, I saw another user had my same problem. email.AndPermissions.forEach is not a function. You said to him to check the variable name. It is not about the name.
      As I said I needed this script so I went over and over at lesst 50 times.
      It doesnt work for me and apparently for this other user.
      So, if you want to help, ok, otherwise no problem. I will find a solition

  • @nathanham1636
    @nathanham1636 Před rokem +1

    Hi, how can I have this script run automatically whenever a new entry is added? I don't want to click it every time :)

    • @saperis
      @saperis  Před rokem

      You have to add a onEdit trigger. Find out more about triggers: czcams.com/video/KC7pBjD3GGw/video.html

  • @ArkadiaTube
    @ArkadiaTube Před rokem

    Can we run a zap to automatically run the script? I have Kajabi course that grants access to a spreadsheet to the person that purchases the course (currently adding students to the sheet manually - trying to learn how to automate this process). So I can create a zap (when student signs up in Kajabi, add data to “sharing automation” spreadsheet). I’d like to use a zap to also automatically run the script once new data is added to the “sharing automation” spreadsheet. So if someone signs up for the course in the middle of the night, I don’t need to go click a button to share the file with them.
    Thank you! Appreciate any insights you can offer!

    • @saperis
      @saperis  Před rokem

      I'm assuming you are referring to using Zapier to automate the process. I know you can automate lots with Zapier, have never done so myself though.

    • @psalm1.0
      @psalm1.0 Před 4 měsíci

      Did you figure this out? I have pretty much the exact same issue as you

  • @livinglife7049
    @livinglife7049 Před 2 lety

    Hello ik this is totally unrelated but one quick question: I am currently trying to get some photos from my phone but it's damaged is there a way that I could sign into my original account on either Google photos or Google files to get them back?

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

      Sorry, we don't use Google Photos at all. So we have no clue if this is possible. ☹

    • @livinglife7049
      @livinglife7049 Před 2 lety

      @@saperis Ok thanks for the info

  • @htablet6424
    @htablet6424 Před 2 lety

    Great video,
    I want one file one email, 2nd file 2nd email
    Give idia

    • @saperis
      @saperis  Před 2 lety

      Whenever you want to create a new script you check the documentation. What methods exist? How can you use them?
      See here: developers.google.com/apps-script/reference

  • @justsurfin5013
    @justsurfin5013 Před 2 lety

    Question, what if you have more than one FileID in column A? I tried this and it only did one file and ignored the remainder. I saw that the ForEach loop was just for the permissions list but there was no loop for the fileID list? Tried to figure it out but beyond me.

    • @saperis
      @saperis  Před 2 lety

      Correct, my script only expects one file ID.
      You would have to create adapt the script quite a bit to make it get n-amounts of file IDs and then loop over them.

    • @justsurfin5013
      @justsurfin5013 Před 2 lety

      @@saperis And you just fed my OCD a pet-project :) I can see where this would be useful for permission templates. Thanks for giving me something to chew on.

    • @danielkwok6460
      @danielkwok6460 Před 2 lety

      @@justsurfin5013 did you ever figure out how to do this?

    • @KhanhNguyen-yq5is
      @KhanhNguyen-yq5is Před rokem

      @@saperis Thanks for your great tool. It just save me a lot of time adding ppl in the file. Anyways, I need to share mutiple files (more than 1 ID) to different ppl, do you have any idea on how to adjust the script. Thank you

    • @saperis
      @saperis  Před rokem

      @@KhanhNguyen-yq5is You could change the script so that it gets all the values in the file ID column and then iterates over them.

  • @arshanurag5658
    @arshanurag5658 Před 2 lety

    Hey one doubt... Why I'm getting "TypeError: emaiAndPermissions.forEach is not a function".

    • @saperis
      @saperis  Před 2 lety

      I'm guessing you have a typo in your code. Did you really name your variable 'emaiAndPermissions'? Or is it 'emailAndPermissions'?