List Drive Labels
📖 Definition
The 📋 List Drive Labels action allows you to retrieve a list of all available labels in Google Drive for a specified user. Labels help classify, organize, and filter files effectively across your organization.
With this action, you can:
- 🔍 View metadata like title, description, and creation time for each label
- 🏷️ Access detailed label structure including fields and their permissions
- 🔄 Use pagination to retrieve large sets of labels with ease
- 👤 Customize label results based on user access level or admin execution
This action is especially useful for audits, compliance checks, or dynamic workflows where label management is critical.
💡Example Use Cases
🔎 Label Audit & Reporting
Quickly retrieve all labels applied across Drive to generate audit reports, verify compliance, or review organizational taxonomy.
🛠️ Dynamic Form/Dropdown Population
Use the label list to populate dropdowns or options dynamically in custom workflows where users select labels to apply or search with.
🧑🏫 Onboarding Automation
Automatically display available Drive labels to educate new employees or teams on how to use standardized labels within your org.
🔁 Workflow Branching
Fetch labels and branch logic based on label types or access levels, ensuring users only interact with what they're permitted to use.
🧹 Cleanup and Label Management
Get a complete list of labels to identify outdated or unused ones, helping admins clean up and optimize the label structure.
📝Inputs
🔐 Connection
What it is:
A Google Workspace Administration connection. This is essential for authenticating and authorizing the action to access label data across Google Drive.
How to use:
You need to upload a credential JSON file for a service account with domain-wide delegation enabled.
📘 Setup guide: Creating a Google Workspace Administration connection
📧 User Email
What it is:
The email address of the user whose accessible Drive labels you want to list.
Why it matters:
This determines the scope of visibility — the returned labels will be based on the access permissions of this user. Make sure this user has the correct roles or visibility on the labels.
✅ Published Only
What it is:
A boolean toggle (yes
/no
) indicating whether to return only published labels.
Use case:
- Set to
yes
if you only want to retrieve labels that are finalized and made available for use. - Set to
no
if you also want to include draft or unpublished labels (often used internally or under development).
🔁 Page Token
What it is:
An optional value used for pagination. If you're retrieving a large number of labels, this token helps you get the next set of results.
When to use:
Use the token provided in the Next Page Token
output from a previous run to continue fetching more labels.
🔢 Page Size
What it is:
The number of label entries you want to return in one call.
Best Practice:
Specify a number (e.g., 100) if you expect a large number of labels and want to control how much data is returned in a single request.
👤 Execute as Domain Admin
What it is:
A boolean field (yes
/no
) that, when enabled, allows the request to run using the user's admin privileges.
Why this matters:
- Set to
yes
to retrieve all labels across the domain, which may not be visible to a regular user. - Set to
no
if you only want to retrieve labels available to the provided user email.
🧩 Minimum Role
What it is:
This defines the minimum access level the specified user must have to see the returned labels.
Options include:
label role unspecified
– No filtering based on access level.reader
– User must be able to view the label.applier
– User must be able to apply the label to files.organizer
– User must be able to organize/edit metadata of the label.editor
– Full edit access.
Pro tip:
Set this to match your use case — e.g., use applier
if you only care about labels that the user can apply to files.
Outputs
📦 Labels
This is the main output, which will be returned as a list of items, with each item representing a label available in Google Drive for the specified user.
Each label item contains the following details:
- 🆔 Label Id – The unique identifier of the label (used to reference or manage the label).
- 🏷️ Label Title – The display name of the label.
- 📝 Description – Optional text explaining the purpose or usage of the label.
- 🔄 Revision Id – A version ID used to track changes to the label definition.
- 🕒 Create Time – The date and time when the label was created.
- 🏷️ Label Type – The type of label (e.g., shared or private).
- 🔠 Label Name – The system-generated name for internal references.
- 📅 Revision Create Time – The time when the latest label revision was created.
- 📢 Publish Time – The timestamp when the label was published (made available for use).
🧩 Fields
Each label may include custom fields. This section includes:
- 🆔 Field Id – Unique identifier of the field.
- 📝 Field Title – The name of the field.
- ⚙️ State – Indicates if the field is
active
,disabled
, or in another state. - 🔍 Query Key – Used in search filters to find files by label field.
- 👁️ Can Read – Indicates if the user can view this field.
- 🔎 Can Search – Indicates if this field can be used in search queries.
- ✏️ Can Write – Indicates if the user can edit or write to this field.
- 🧩 Selection Options – For fields that allow multiple choices (like dropdowns).
- 📆 Date Options – If the field is date-based, this defines its behavior.
- 🔤 Text Options – For free text or string-type fields.
🔁 Next Page Token
If there are more labels to retrieve than the specified Page Size, this token will be included.
📌 You can use this token as input in the Page Token field on the next run to continue retrieving additional labels.
✅ Example: Auditing Drive Labels for Compliance
Scenario:
A Google Workspace admin needs to audit all custom labels applied across their organization's Drive files to ensure they meet internal compliance rules (e.g., labels like “Confidential,” “Financial,” or “HR Only”).
How they use the action:
- In Zenphi, they add the List Drive Labels action to a flow.
- They configure the action with:
- ✅ Connection: Their admin service account connection with domain-wide delegation.
- 📧 User Email: An email of a user whose Drive contains key labels (or rotate through users in a loop).
- 🛠️ Execute as Domain Admin: Set to “Yes” to retrieve all labels across the customer domain.
- 🧾 Minimum Role: Set to “reader” to ensure only readable labels are fetched.
- Once the flow runs, it retrieves all available labels, including their descriptions, revision data, and access settings.
- These labels are reviewed (possibly exported or mapped) to ensure they align with the company’s data classification standards.
Updated 4 days ago