Save modified google sheet Template to shared drive instead of each user/accessors personal google drive - google-apps-script

I am looking to work around the limitation to save an updated template or copy in google sheets to a specified share drive that stores the original file. Could I create a shared drive with all of the users I want to modify the template and put the template in the drive and each of the users access the file and their modifications saved in that shared drive as unique files?
Context: https://support.google.com/docs/thread/22231997?hl=en#

You can create a customized shared drive from the user interface
Go to https://drive.google.com and click on "Shared drives"
Right-click onto the white field and select "New shared drive"
Chose a name and click on "Create"
At the left top, click on "Add members"
Enter the email addresses of the users you want to add and click on "SEND"
Go on "Manage members" and give to each one personalized permissions, if desired
IF YOU WANT TO SHARE YOUR DRIVE PUBLICLY
Unfortunately currently it is not possible to share a drive publicly, however, when you create a file inside the shared drive (or on your drive), you can edit the sharing permission and choose the option that everybody with the link has access to your file. In this case, all you need to do is to share the link with the users.
Keep in mind that the users will not be able to save a copy of the file on the shared drive if they have not been added to the drive.
If you are interested in a Workaround
You can create a Google Form and ask the users to submit their file as an attachment to the Google Form. In this case, all the files will be stored on your drive, once the users submit their forms.

Related

Transfer files from Google Drive to a different domain

How can I transfer all my files from a google drive account to another google drive account, but from different domain and organisation.
I tried with Transfer Ownership, but I recieve an error when I choose to which user I want to transfer the files.
"Error: Select a user from search results"
Transfer of Ownership with Google Drive
It would be important to clarify at first what is possible and the workarounds. First we need to make sure that your organization has enabled the option to share files with outside users or make it public.
The [transfer of ownership][1] is only available or allowed between users from the same organization.
Method 1 (Make a Copy)
The first method that I suggest is to move all data to a folder from your Drive and share that folder directly with the other user. For example the folder would be under user "A" and you would share it with the user from another domain, the user "B".
Login to with user "B" and check under "Recent" option over, it should be on the left of the Drive UI.
You should be able to access the folder that was recently shared or with the link of the folder (I suggest having the user "B" account under an incognito window). You can start from there picking the files and making a copy, the copy would be under the ownership of user "B".
Method 2 (Shared Drives)
If your new organization or domain has Shared Drives, you should be able to add the external users as "Manager", you would need to add user "A". This way the user "A" would be able to move files directly to the Shared Drive, and due to the Shared drives not having owners but "Managers" or other permissions, the file becomes part of the new organization and is available to be moved by the users of the new organization.
Method 3 (Google Takeout)
If none of these options helps you, you can utilize Google Takeout to download all your Google Data.
You can review how it works below:
https://support.google.com/accounts/answer/3024190
References
https://support.google.com/a/answer/7374057
https://support.google.com/drive/answer/2375091?hl=en&co=GENIE.Platform%3DDesktop#zippy=%2Cmake-a-copy-of-a-file
[1]: https://support.google.com/a/answer/1247799?hl=en
In addition to Ricardo's full answer:
Method 2b (automated)
Even if your Google Workspace has no Shared Drives you might use this method with Google Drive add-on or web-app.

Allow Anyone to Upload Files Directly to my Google Drive

I would like to allow my students to send me one or more files directly to my google drive via a form where they would just enter their name and choose the file(s) to send (drag and drop would be great). A folder with their name would be created in a specific folder on my drive and a warning email would be sent to me. Do you think this is feasible with google script? Thanks in advance.
An example here but paying ...
I've checked and Google Forms already allows for a File Upload kind of question (with drag and drop too).
It automatically creates a folder in your Google Drive (altough it doesnt create a folder for every student) (example here) and in the spreadsheet that it automatically generates there is a permanent link to that file (example here).
If that's not what you are looking for and you need the 'Folder per student' feature then yes, you can use google apps script to move files in folders quite easily.

Sharing through google app script

I am Ashwin. I have a scenario on Google App Scripts. " Whenever a user clicks on the 'Create' button in Google Drive, that particular file should automatically be shared with a particular email address". Can anyone help me out in this?
While this is possible with Google Script, an easier option would be that you create a separate folder in your Google Drive and share it with an email address. Now any file that you create inside that folder will automatically be available to that address.
The suggestion on using a folder is good. Else with script you cant hook into drives create button. But you can have a script on that user on a time trigger constantly searching for files created/modified since last time you checked and if the user is owner, share it with the other email. Even better share it with a google group so later is easier to modify the shared-to user on a single spot.

Add a shared folder to google drive using a share link

Newest Edit:
So here is what i want to accomplish:
1) User installs my application on his computer.
2) User grants my app access to his drive.
3) My app shares a folder from my drive with the user.
The problem in accomplishing part 3) is that my app actually needs write access to my drive, so it can share my folder with the current user. But for security reasons there is no way i can grant my app write acces to my drive.
Now im asking for a possibility to perform part 3) without granting my app write access for my drive.
I would like my installed application to add a shared folder to a users google drive account by only using a share link i generated manually for a folder i've created in my drive. Is it possible to accomplish this using google drive API?
Edit: What i actually want to do is to create a folder in the users drive and link this folder to a folder in my drive, so the user can access the files stored in my drive.
A shortcut to another's shared directory? Google Drive doesn't support it but, you can create an application to handle it.
Create a shortcut to your application.
Add the the link you want your user to be redirected as a custom property to the shortcut file.
When user opens the file from Drive and being redirected to your app, read the custom property you stored.
Redirect user to the the location on the retrieved custom property.

Google App script - Upload files to Google Drive account other than the currently logged in one?

I have been able to upload files to a Google Drive account from within a Google Spreadsheet. The problem is that as far as I am able, I can only upload files to the currently logged in account.
Is it possible to be logged in with account A and viewing a spreadsheet, but upload files to account B from a menu option? Is this even allowed/possible?
Use Case:
I have a spreadsheet with a couple of sheets. A user login will only have access to edit one sheet on the spreadsheet, but as part of that sheet the user should be able to upload photos to the spreadsheet owners google drive. So the main "admin" account holds the spreadsheet and photos and then there are a couple of edit accounts with edit rights to a specific sheet.
Can you provide your Use Case for this?
It is possible to add Editors to the document (https://developers.google.com/apps-script/class_file) which may be what you are looking to accomplish.
More details would help.
You should publish your script as a web app. When you do that, you will be provided the option of executing the script as you(owner of the script) or as the user running the script. Use the latter option to upload files to the user's Google Drive