List Shared Drives

Definition

The "List Shared Drives" action in Google Drive allows users to retrieve a list of shared drives they have access to or shared drives across an entire domain if executed by a domain administrator. It provides a flexible way to query, filter, and paginate shared drives. Administrators can list all shared drives, apply filters to refine their search results, and set a limit on the number of drives returned in a single query. This action is ideal for managing and reviewing shared drives within an organization or domain.

Key Capabilities:

  • List all shared drives accessible to a user or across the domain.
  • Filter results based on a query to retrieve specific shared drives.
  • Control the number of results returned.
  • Pagination support for retrieving large datasets across multiple pages.

Example Use Cases

1. Organization-wide Shared Drive Overview

A domain administrator wants to see all shared drives within their organization to get an overview of their content and management. Using this action with "Execute as Domain Admin" enables the retrieval of all shared drives within the domain.

2. Filtering Shared Drives by Name

A user needs to retrieve shared drives that contain specific keywords in their names. They can use the Query parameter to filter drives based on name and only return relevant results, making it easier to find specific shared drives.

3. Reviewing User Access to Shared Drives

An administrator wants to list all shared drives they have access to. This allows them to quickly check which drives they can manage or collaborate on without needing additional admin permissions.

4. Retrieving Shared Drives by Creation Date

A team lead needs to gather shared drives created within a specific time period. Using the Max Results field and appropriate filters, they can retrieve recent shared drives for analysis.

5. Managing Large Numbers of Shared Drives

For organizations with many shared drives, this action's Next Page Token and pagination features allow administrators to retrieve results in batches, helping them manage large datasets without running into performance issues.


Step-by-Step Guide

Step 1: Add the Google Drive Connection

Ensure you have a valid connection to your Google Drive account or domain. If you’re using the Execute as Domain Admin option, ensure your account has domain administrator privileges to access shared drives across the domain.

Step 2: Set the "Execute as Domain Admin" Field

Choose whether the action should be executed as a Domain Admin. If you need to retrieve shared drives across the entire domain, set this field to True. If you only need to access shared drives you have permissions for, set this field to False.

Step 3: Define the "Query" Field (Optional)

If you want to filter the shared drives returned, provide a Query. For example, you could input a keyword related to the shared drive’s name, or filter based on other available properties (e.g., organization unit ID, etc.).

Step 4: Set the "Max Results" Field

Specify the Max Results to determine how many shared drives you want to retrieve in a single request. If you want to return up to the maximum of 20,000, input that number. If you're testing, you may want to use a smaller number, like 100.

Step 5: Provide a "Page Token" for Pagination (Optional)

If you’re expecting multiple pages of results, input a Page Token from the previous request to fetch the next page. If you’re just starting, leave this field empty to retrieve the first page.

Step 6: Run the Action

  • Trigger the action to list the shared drives. The system will fetch and return the shared drives based on the criteria set above.

Step 7: Handle the Response

  • Review the response, which will include:

    Result Count: The total number of shared drives returned in the current request.

    Drives Collection: Detailed information for each shared drive, including ID, Name, Creation Time, etc.

    Next Page Token: If there are more results, this will allow you to paginate through the remaining drives.

Step 8: Use the Next Page Token (Optional)

  • If there are additional shared drives not included in the first page of results, use the Next Page Token from the current response in the next request to retrieve the remaining shared drives.

This flow ensures you can list all shared drives available to your account (or across your domain) with full control over pagination and filtering.


Outputs

1. Result Count

The total number of shared drives retrieved in the current response.

Usage: This is the count of shared drives returned by the action. If the result count is lower than the Max Results you set, it means there are no more drives left to retrieve. If it's equal to or less than Max Results, there may still be more shared drives to fetch.

2. Drives Collection

Description: A list of shared drives retrieved, including the following details for each drive:

  • Id: The unique identifier of the shared drive.
  • Name: The name of the shared drive.
  • Hidden: Indicates whether the shared drive is hidden.
  • Created Time: The timestamp when the shared drive was created.
  • Org Unit Id: The organization unit ID of the shared drive.
  • Usage: This is a collection of all the shared drives returned, allowing you to view detailed information about each one. This can be used for tasks such as listing, managing, or auditing shared drives within your Google Drive.

3. Next Page Token

A token used to fetch the next page of shared drives if there are more than the maximum results specified.

Usage: If the number of shared drives exceeds the Max Results limit, this token helps in pagination, allowing you to retrieve the remaining drives on the next page by using this token in subsequent requests.

This set of outputs provides you with the information you need to view, paginate, and manage the shared drives within your Google domain or personal account.


Example of Using

Scenario:
A company admin wants to list all the shared drives within their Google Workspace account to ensure that only authorized teams have access to specific drives. The admin needs to retrieve information on shared drives to confirm names, creation times, and whether any shared drives are hidden.

Step-by-Step Process:

  1. Set Connection: The admin connects to their Google Drive account or uses a domain admin account to get all shared drives in the organization.
  2. Configure Inputs: The admin sets the following parameters:
    • Execute as Domain Admin: Set to true to list all shared drives across the domain.
    • Max Results: Limits the number of drives returned (e.g., 100 drives).
    • Query: Set to filter shared drives by specific criteria, such as department name or project (optional).
  3. Execute Action: The action is triggered to fetch the list of shared drives.
  4. View Results: The admin receives a list of shared drives with details like ID, name, creation time, and whether they are hidden or not.
  5. Pagination: If there are more than 100 drives, the admin uses the Next Page Token to fetch additional drives.

This action helps the admin manage and audit shared drives within the organization efficiently.