Share File/Folder
📖 Definition
The "Share File/Folder" action in the Google Workspace category enables you to grant access to specific files, folders, or shared drives in Google Drive by assigning permission roles to users, groups, or domains. 🗂️
With this action, you can:
- 🔐 Control who can view, comment, or edit content by specifying the appropriate roles (like
reader
,writer
, orcommenter
). - 👥 Share with individuals (
user
), groups, your entire domain, or even publicly (anyone
). - ✉️ Optionally send notification emails when sharing access.
- 🛡️ Use admin privileges to manage permissions on shared drives more efficiently.
This action is perfect for automating permission management in workflows that involve file collaboration, document sharing, or project handoffs.
📌 Example Use Cases
📁 Team Folder Access Automation
Automatically grant access to a shared project folder when a new team member is onboarded, ensuring they can start collaborating right away.
🔄 Cross-Department File Sharing
Share specific documents (like reports or assets) across departments by assigning access to groups or domains in a secure and controlled manner.
🚀 Client Deliverable Sharing
Automate the sharing of finalized files with clients by giving them view-only access via their email, ensuring privacy and professionalism.
🧪 Temporary Access for Reviews
Give temporary editing or commenting permissions to external reviewers for collaborative feedback, and revoke access later as needed.
🏢 Domain-Wide Resource Sharing
Distribute policy documents or training materials across the entire company domain efficiently by assigning reader access to all employees.
👤 Role-Based Permission Assignment
Use different permission roles (reader, writer, commenter) based on the recipient's responsibility—great for structured access control in multi-stakeholder workflows.
📝 Inputs
🔑 Connection
The connection to your Google Workspace account. This is where you'll provide your Google Workspace Admin connection credentials. You need to upload a credential JSON file for a service account with domain-wide delegation for the action to have the necessary permissions to access and share files or folders on Google Drive.
- Usage: This is required to authenticate and authorize the connection to your Google Workspace instance. The connection will give Zenphi the ability to interact with Google Drive on behalf of the user.
📧 User Email
The email address of the user for whom the file or folder is being shared. This refers to the Google Workspace user who owns the file/folder or the one who will be sharing it.
- Usage: This helps determine which user's file or folder is being shared and ensures the correct permissions are applied. Typically, this will be the person managing the file or the owner of the folder.
🗂️ File or Folder ID
The unique identifier (ID) for the file or folder you wish to share.
- Usage: You will input the ID of the file/folder you want to share from Google Drive. To find this ID, you can use the Google Drive UI or refer to the file URL which includes the ID.
- Example: The file URL might look like
https://drive.google.com/file/d/1234567890abcdef/view
, where the ID is1234567890abcdef
.
- Example: The file URL might look like
🔒 Role
Specifies the access level you are granting to the file/folder. The available options are:
- "reader": The user can only view the file or folder.
- "writer": The user can edit the file or folder.
- "commenter": The user can comment on the file/folder.
- "owner": The user is given full control, including the ability to remove others and manage permissions.
- Usage: This field controls the level of interaction the recipient will have with the shared file/folder.
🌍 Type
Defines the scope of access for the recipient. Options include:
- "user": Applies the permission to a specific user.
- "group": Applies the permission to a Google Group, allowing all group members access.
- "domain": Applies the permission to everyone within a specific domain (e.g., all users in your organization).
- "anyone": This applies the permission to anyone, even if they are not part of the domain or organization.
- Usage: This controls whether the permission applies to one individual, a group, everyone within a domain, or the public.
📬 Email Address
The email address of the person (or group) who will be receiving the shared file/folder.
- Usage: If you selected "user" or "group" as the permission type, you'll need to enter the email address for the user or group to share the file/folder with.
🛠️ Run as Domain Admin
If set to true, the action will run with domain admin privileges. This allows access to files within a shared drive even if the requester is not the owner but is an administrator for the domain.
- Usage: Useful for administrative actions where files in shared drives need to be accessed or shared without ownership of the files.
📧 Send Notification Email
A checkbox that allows you to send a notification email to the user when the file or folder is shared with them.
- Usage: If selected, the user will receive an email informing them about the new shared file or folder and their access level. This is helpful for ensuring users are notified about their new access permissions.
📊 Outputs
🔑 Permission Id
The Permission ID is a unique identifier for the permission applied to the file or folder in Google Drive. This ID is assigned to the specific permission or access rule granted to a user, group, domain, or anyone.
-
Usage: The Permission ID is used to reference and manage the specific permission applied to the file or folder. For example, if you need to modify or remove the shared permissions later, you can use this Permission ID to target and identify that specific permission. It is essential for auditing and managing permissions over time.
-
Why it’s important: The Permission ID allows for precise tracking of which user or group has what level of access to a particular file or folder. This ensures that you can manage and troubleshoot access issues efficiently by knowing exactly which permission was granted.
💡 Example: Sharing a File with a Specific User
Scenario:
Imagine a scenario where your company has a shared folder in Google Drive that contains sensitive financial reports. You need to share a specific report with a team member (e.g., "[email protected]") but do not want to share the entire folder with them.
Steps:
-
Action Setup:
- Use the "Share File/Folder" action.
- Input the Connection to authenticate with Google Workspace.
- Set the User Email to the email address of the team member you want to share the report with (e.g., "[email protected]").
- Input the File ID of the specific report you want to share.
- Choose the Role for John (e.g., "Reader", to give him view-only access).
- Set the Type to "user" since you're sharing with a specific person.
- Optionally check Send notification email to notify John that the file has been shared with him.
- Set Run as a domain admin to true if the shared file is in a shared drive and you want to ensure that John gets access, even if it's a shared domain drive.
-
Outcome:
- The file is now shared with John, and he receives a notification email about the shared report.
- The Permission ID for this specific sharing permission is generated, allowing you to track or modify access later.
Why It’s Useful:
This action simplifies managing access to individual files in Google Drive, ensuring that only the appropriate team members have the correct level of access while maintaining control over sensitive company data.
Updated 4 days ago