> For the complete documentation index, see [llms.txt](https://docs.docontrol.io/docontrol-user-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docontrol.io/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/get-file-metadata.md).

# Get file metadata

You can retrieve metadata of selected files in Google Drive, such as their sharing status, the owner, Google labels, or if the file is located in a hidden drive.

<figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FpN5fzEtxmAULvlEJuCS6%2FGetFilemetadata.gif?alt=media&amp;token=51272ccd-5eb8-4845-9c7e-5fee5b7bb25c" alt=""><figcaption></figcaption></figure>

#### To retrieve file metadata from Google Drive assets:

1. From the **Actions** left pane, select **Query** **> Google Drive > Get file metadata,** drag the action to the canvas, and connect it to the previous action.<br>

   <div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FjoEsraz3yaREAwRoPPj1%2Fget%20file%20metadata.png?alt=media&amp;token=8da32ed8-673b-42d0-9210-ea6814233ddf" alt="" width="563"><figcaption></figcaption></figure></div>
2. Add a step description (optional).
3. Define the action settings:
   * **Asset ID** - You can change the asset ID field by clicking the **Plus**  <img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FMFokaiNx127HyZD93Ph3%2Fplus%20icon%202.png?alt=media&amp;token=6bd9644a-ea2a-4969-81de-0a49a61b3dd7" alt="" data-size="line"> icon to add [dynamic values](/docontrol-user-guide/workflows/define-workflow-settings/action-settings.md#dynamic-data) to include details from the event.
   * **Error handling** -  Define how to proceed in case an error occurs.

## Leverage Google Drive labels in workflows

You can leverage [Google labels](https://support.google.com/a/answer/9292382?sjid=1699548025564226542-EU) in DoControl workflows to mitigate file exposure for assets with specific labels.

A Google label is metadata or tags that allow your company to organize, find and apply policies to Google Drive files, especially if the content is sensitive or classified. DoControl leverages Google labels with HR and IdP (identity provider) metadata to boost your Google Drive data security beyond its standard capabilities.

{% hint style="success" %}

* To apply Google labels automatically to files across your organization's Google Drive, see [Google Workspace Admin Help](https://support.google.com/a/answer/13127870#dlp).
* If you are an existing customer and want to leverage Google Drive labels, you need to [re-integrate DoControl with Google Workspace](/docontrol-user-guide/integrations/integrations-google-drive/define-scopes.md) by defining scopes.
  {% endhint %}

DoControl retrieves your Google labels via the **Get file metadata** step, and displays these labels in the execution details for the specific workflow.

<div align="left"><figure><img src="https://3236294211-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MesrnyDMZGYg1V-tOBo%2Fuploads%2FBmxjZITTeHvVRxd6XMd8%2Flabel%20metadata.png?alt=media&amp;token=0dd6dff0-ca1b-4357-8170-31b178bc2aea" alt="" width="563"><figcaption><p>DoControl retrieves Google label metadata in the Get file metadata workflow step</p></figcaption></figure></div>

{% hint style="success" %}
To customize a predefined workflow, see the [prevent public sharing of files with sensitive Google label](/docontrol-user-guide/risk-management/threat-model-coverage/public-sharing/google-drive-playbooks-for-public-sharing.md#prevent-public-sharing-of-files-with-sensitive-google-label) playbook.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docontrol.io/docontrol-user-guide/workflows/define-workflow-settings/action-settings/query/get-file-metadata.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
