# Google Drive

Google Drive is a cloud storage service provided by Google. It allows users to store, access, and share files from any device at any time, making it ideal for backup, collaboration, and seamless integration with other Google Workspace applications.

To integrate Google Drive with ZBrain Flow, follow these detailed steps:

* Click the '+' button in the Flow and search for **Google Drive** in the ZBrain Flow.
* Select the specific task from the list you want to include in the Flow. You can perform the below-listed tasks:
  * **Create New File**: Create a new text file in your Google Drive from the provided text.
  * **Create New Folder**: Create a new empty folder in your Google Drive.
  * **Custom API Call**: Make a custom API call to a specific Google Drive endpoint.
  * **Delete File**: Permanently delete a file from your Google Drive.
  * **Delete Permissions**: Remove a role from a user for a specific file or folder.
  * **Duplicate File**: Duplicate a file from Google Drive and return the new file ID.
  * **Get File**: Retrieve a file or folder for files/sub-folders.
  * **List Files**: List files from a Google Drive folder.
  * **Move File**: Move a file from one folder to another.
  * **Read File**: Read the contents of a selected file from Google Drive.
  * **Save File as PDF**: Convert and save a file as a PDF in a Google Drive folder.
  * **Search**: Search a Google Drive folder for files or sub-folders.
  * **Set Public Access**: Set public access for a file or folder.
  * **Trash File**: Move a file to the trash in your Google Drive.
  * **Update Permissions**: Update permissions for a file or folder.
  * **Upload File**: Upload a file to your Google Drive.

### **Create New File** <a href="#create-new-file" id="create-new-file"></a>

Create a new text file in your Google Drive from the provided text.

#### **How to Configure Create New File** **to ZBrain Flow?** <a href="#how-to-configure-create-new-file-to-zbrain-flow" id="how-to-configure-create-new-file-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the name of the file in the **File name** field.
* Provide the text content to add to the file in the **Text** box.
* Select the desired value, which is the content format, from the **Content type** drop-down.
* Select the folder name from the **Parent Folder** drop-down.
* **Optional Settings**
  * **Include Team Drives:**\
    Files and folders stored in shared drives (Team Drives) are also considered for file creation when enabled. If disabled, operations are limited to your personal Google Drive.

### **Create New Folder** <a href="#create-new-folder" id="create-new-folder"></a>

Create a new empty folder in your Google Drive.

#### **How to Configure Create New File** **to ZBrain Flow?** <a href="#how-to-configure-create-new-file-to-zbrain-flow-.1" id="how-to-configure-create-new-file-to-zbrain-flow-.1"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the new folder name in the **Folder name** text box.
* Select the parent folder, if any, from the **Parent Folder** drop-down.
* **Optional Settings**
  * **Include Team Drives:**\
    Files and folders stored in shared drives (Team Drives) are also considered for file creation when enabled. If disabled, operations are limited to your personal Google Drive.

### **Custom API Call** <a href="#custom-api-call" id="custom-api-call"></a>

Make a custom API call to a specific Google Drive endpoint.

#### **How to Configure Custom API Call** **to ZBrain Flow?** <a href="#how-to-configure-custom-api-call-to-zbrain-flow" id="how-to-configure-custom-api-call-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the **URL.** The **URL** refers to the specific endpoint of the API you want to interact with. This endpoint determines the resource or action the request will address (e.g., creating events, updating calendars, retrieving event details).
* Choose the **Method** to be used for the API call.
* Provide the **Headers.** These are key-value pairs sent along with the API request to convey additional information (e.g., authentication tokens, content type). Headers help the server process your request correctly. Authorization headers are injected automatically from your connectio&#x6E;**.**
* Provide the **Query Parameters** object. These are appended to the URL and are typically used to filter or modify the request. For example, adding `?status=active` might limit results to only active records.
* Include the main data payload (in formats such as JSON or form data) in **the Body** when making a request to create, update, or process the server's information.

### **Delete File** <a href="#delete-file" id="delete-file"></a>

Permanently delete a file from your Google Drive.

#### **How to Configure Delete File** **to ZBrain Flow?** <a href="#how-to-configure-delete-file-to-zbrain-flow" id="how-to-configure-delete-file-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the ID of the file to be deleted in the **File ID** box. This is the unique identifier for the file you want to delete. This tells Google Drive which specific file to remove.
* **Optional Settings**
  * **Include Team Drives:**\
    Files and folders stored in shared drives (Team Drives) are also considered for file creation when enabled. If disabled, operations are limited to your personal Google Drive.

### **Delete Permissions** <a href="#delete-permissions" id="delete-permissions"></a>

Remove a role from a user for a specific file or folder.

#### **How to Configure Delete Permissions** **to ZBrain Flow?** <a href="#how-to-configure-delete-permissions-to-zbrain-flow" id="how-to-configure-delete-permissions-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the ID of the file or folder to update permissions for in the **File or Folder ID** field.
* Provide the user's email address to update permissions in the **User email** field.
* Select the role of the user from the **Role** drop-down.

### **Duplicate File** <a href="#duplicate-file" id="duplicate-file"></a>

Duplicate a file from Google Drive and return the new file ID.

#### **How to Configure Duplicate File** **to ZBrain Flow?** <a href="#how-to-configure-duplicate-file-to-zbrain-flow" id="how-to-configure-duplicate-file-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the ID of the file to duplicate in the **File ID** box.
* Provide the name of the new file in the **Name** box.
* Provide the ID of the folder where the file will be duplicated in the **Folder ID** field.

### **Get File** <a href="#get-file" id="get-file"></a>

Retrieve a file or folder for files/sub-folders.

#### **How to Configure Get File** **to ZBrain Flow?** <a href="#how-to-configure-get-file-to-zbrain-flow" id="how-to-configure-get-file-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the ID of the file/folder to search for in the **File / Folder ID** field.
* **Optional Settings**
  * **Include Team Drives:**\
    Files and folders stored in shared drives (Team Drives) are also considered for file creation when enabled. If disabled, operations are limited to your personal Google Drive.

### **List Files** <a href="#list-files" id="list-files"></a>

List files from a Google Drive folder.

#### **How to Configure List Files** **to ZBrain Flow?** <a href="#how-to-configure-list-files-to-zbrain-flow" id="how-to-configure-list-files-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the **Folder ID** value, which could be a new folder ID or an existing folder ID.
* **Optional Settings**
  * **Include Team Drives:**\
    Files and folders stored in shared drives (Team Drives) are also considered for file creation when enabled. If disabled, operations are limited to your personal Google Drive.

### **Move File** <a href="#move-file" id="move-file"></a>

Move a file from one folder to another.

#### **How to Configure Move File** **to ZBrain Flow?** <a href="#how-to-configure-move-file-to-zbrain-flow" id="how-to-configure-move-file-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the file name in the **File ID** using the Search Folder/File action to retrieve the ID.
* Provide **Parent Folder** value. It refers to the new destination folder where you want to place the file. By specifying a parent folder, you define the exact location where the moved file will reside in Google Drive (or Team Drives if enabled).

### **Read File** <a href="#read-file" id="read-file"></a>

Read the contents of a selected file from Google Drive.

#### **How to Configure Read File** **to ZBrain Flow?** <a href="#how-to-configure-read-file-to-zbrain-flow" id="how-to-configure-read-file-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the **File ID** value, which could be a new file ID or an existing file ID.
* Provide the **Destination File name**.

### **Save Document as PDF** <a href="#save-document-as-pdf" id="save-document-as-pdf"></a>

Convert and save a file as a PDF in a Google Drive folder.

#### **How to Configure Save Document as PDF to ZBrain Flow?** <a href="#how-to-configure-save-document-as-pdf-to-zbrain-flow" id="how-to-configure-save-document-as-pdf-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the ID of the document to export in the **Document ID** field.
* Provide the ID of the folder where the file will be exported in the **Folder ID** field.
* Provide the name of the new file (do not include the extension) in the **Name** field.
* **Optional Settings**
  * **Include Team Drives:**\
    Files and folders stored in shared drives (Team Drives) are also considered for file creation when enabled. If disabled, operations are limited to your personal Google Drive.

### **Search** <a href="#search" id="search"></a>

Search a Google Drive folder for files or sub-folders.

#### **How to Configure Search to ZBrain Flow?** <a href="#how-to-configure-search-to-zbrain-flow" id="how-to-configure-search-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Select the query term or field of file/folder to search upon from the **Query Term** drop-down.
* Select the operator to create criteria from the **Operator** drop-down.
* Provide the value of the field of file/folder to search in the **Value** field.
* Select the value from the **File Type** drop-down.
* Select the parent folder value from the **Parent Folder** drop-down.
* **Optional Settings**
  * **Include Team Drives:**\
    Files and folders stored in shared drives (Team Drives) are also considered for file creation when enabled. If disabled, operations are limited to your personal Google Drive.

### **Set Public Access** <a href="#set-public-access" id="set-public-access"></a>

Set public access for a file or folder.

#### **How to Configure Set Public Access to ZBrain Flow?** <a href="#how-to-configure-set-public-access-to-zbrain-flow" id="how-to-configure-set-public-access-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the ID of the file or folder to update permissions for in the **File or Folder ID** field.

### **Trash File** <a href="#trash-file" id="trash-file"></a>

Move a file to the trash in your Google Drive.

#### **How to Configure Trash File to ZBrain Flow?** <a href="#how-to-configure-trash-file-to-zbrain-flow" id="how-to-configure-trash-file-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the ID of the file to the trash in the **File ID** field.
* **Optional Settings**
  * **Include Team Drives:**\
    Files and folders stored in shared drives (Team Drives) are also considered for file creation when enabled. If disabled, operations are limited to your personal Google Drive.

### **Update Permissions** <a href="#update-permissions" id="update-permissions"></a>

Update permissions for a file or folder.

#### **How to Configure Update Permissions to ZBrain Flow?** <a href="#how-to-configure-update-permissions-to-zbrain-flow" id="how-to-configure-update-permissions-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the ID of the file or folder to update permissions for in the **File or Folder ID** field.
* Provide the email address of the user to update permissions in the **User email** field.
* Select the role to grant to the user from the **Role** drop-down.
* If you want to send an email to the user to notify them of the new permissions, then enable **Send invitation email**.

### **Upload File** <a href="#upload-file" id="upload-file"></a>

Upload a file to your Google Drive.

#### **How to Configure Upload File to ZBrain Flow?** <a href="#how-to-configure-upload-file-to-zbrain-flow" id="how-to-configure-upload-file-to-zbrain-flow"></a>

* Create a **Connection** with your Gmail ID and save the connection with a proper name, or select the already created connection.
* Provide the name of the file in the **File name** field.
* Provide the file URL in the **File** field.
* Select the parent folder from the **Parent Folder** drop-down.
* **Optional Settings**
  * **Include Team Drives:**\
    Files and folders stored in shared drives (Team Drives) are also considered for file creation when enabled. If disabled, operations are limited to your personal Google Drive.

<br>

<br>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.zbrain.ai/zbrain-documentation/zbrain-builder/flows/flow-components/google-drive.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
