# Google Drive

## Overview

You can create a Google Drive Destination Connector to write CSV files (by default) or JSONL files to a Google Drive folder using your Google account. We do not currently support Shared Drives.

To set up this Destination Connector, your Google account will need access to the Google folder you are connecting to.

**Supported file formats**: We only write to CSV or JSONL files. We cannot write to a Google Sheet using a Google Drive Connector. To write to a Google Sheet, please set up a [Google Sheets Connector](/destination-connectors/google-sheets-connector.md).

{% hint style="info" %}
If you have multi-factor authentication enabled for your Google account, you may need to recreate the Destination Connector when the authentication expires. Re-authentication for existing connections is coming soon.
{% endhint %}

## **Prerequisites**

Required information:

1. Google Drive Folder URL
2. Google Account Username and Password

## Creating a Google Drive Destination Connector

**Step 1:** After selecting **+ New Connector**, under the **System** prompt, click **Google Drive.**

![](/files/8A8CPCsCDlPUQeJPRFHY)

**Step 2:** Provide a **Connector Name.**

**Step 3:** Select **Destination Connector.**

**Step 4:** Provide the **Folder URL.**

### **Step 5: Destination Schema**

Design the output schema via two options, either import the schema or build it within Osmos.

#### Option 1: Schema Import

Upload or drag & drop the schema file.

<figure><img src="/files/yKs5ZJTMuESfIDTTb7ka" alt=""><figcaption><p>Schema Upload</p></figcaption></figure>

{% hint style="info" %}
Import a file with the headers along with one row of sample data.  This data is used only in schema creation.
{% endhint %}

#### **Option 2: Building the Schema for the Destination Connector**

Use the schema designer to build the output schema for this Destination Connector.&#x20;

![](/files/-MZAhLIR_rAexEPvI1Y4)

| Parameter  | Description                                                                                                                                                       |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Field Name | Provide a field name for the output fields. These names will be used as the column headers or field names in the output file you are writing to.                  |
| Type       | Define the type of each field. The field types will be used to enforce rules when you send data to this Connector.                                                |
| Nullable   | Check this box if the field is nullable. If the field is not nullable, you will be required to provide values for this field when sending data to this Connector. |
| Delete     | Deletes the field.                                                                                                                                                |
| Add Field  | Adds another field to the schema.                                                                                                                                 |

\
**1.** Click **Add Field** for each additional field required in the schema.\
\
**2.** Select **Create Schema** once you have built the schema.&#x20;

## **Advanced Options**

**Output File Format**

By default, this Destination Connector writes CSV files, and each Osmos Pipeline run produces a new file. If preferred, you can choose to change the output to JSONL files instead of a CSV files.&#x20;

#### File Prefix Format String

We support the designation of file prefixes in order to more easily manage the output of this connector. The contents of this field will be written into the filename of the data this Connector writes. If a prefix is specified, a UUID will be appended to it to prevent filename conflicts.&#x20;

For additional configuration go to [Additional Configuration for File Prefix Format.](#additional-configuration-for-advanced-options)

#### Limit Records Per File

By default, we do not set a limit on the number of records to be written to a single destination file by a single job (i.e. a single run of a Pipeline or Uploader).  If this box is checked, the data written to the destination will be "chunked" into separate files which contain at-most the number of records designated here. These "chunked" files will be suffixed with it's position in the sequence i.e. *filename*\_part\_1.csv, *filename*\_part\_2.csv, etc.

#### Validation Webhook

We support the use of Validation Webhooks to prevent bad data from being written to your systems, adding another layer of protection to the built-in validations that Osmos provides. The Webhook URL can be posted here.

{% hint style="info" %}
For more information on Validation Webhook configuration, see [Server Side Validation Webhooks](/developer-docs/validation-and-transformation-webhooks.md)
{% endhint %}

#### Overwrite Output Column with Raw Input Data

Enter the name of the destination column where you'd like to store the entire raw source record data. The raw source record data will be stored as a JSON string in the provided destination column.

## Additional Configuration for File Prefix Format

**Organizing File Structure**

A user can chunk files and output to a different naming structure based on job\_id. Osmos leverages a case-sensitive magic string {jobId} in the file prefix and the file output names for these file based Destination Connectors. To set a file prefix, go to the Destination Connector > Show Advanced Options > populate prefix information in the File Prefix Format String field.

#### File Output

We support the designation of file prefixes in order to more easily manage the output of this connector. To set a file prefix, go to the Destination Connector > Show Advanced Options > populate prefix information in the File Prefix Format String field. The contents of this field will be written into the filename of the data this Connector writes. A UUID will be appended to the filename to it to prevent writing conflicts.  Osmos leverages two types of magic string identifiers in order to include additional information in your file prefix.

**Job\_Id**:  You can include an identifier that corresponds each individual Job (a run of an Osmos Uploader or Pipeline) by including ***{jobId}*** in your prefix format string. See examples 3 & 4

**DateTime**: You can include datetime values in your file output using [String from time (strftime) format specifiers](/data-transformations/formulas/date-and-time-formulas/date-format-specifiers.md). The time values created here correspond to Osmos internal system time at the moment the job was started. See example 4

Output Scenarios:&#x20;

1. No file prefix \
   Output: *\<user base path>/chunk-\<chunk num>-\<UUID>.\<file extension>*
2. File includes description in the prefix\
   Sample prefix: *my\_osmos\_output\_*\
   Output: *\<user base path>/my\_osmos\_output\_chunk-\<chunk num>-\<UUID>.\<file extension>*
3. File includes description and job\_id in the prefix\
   Sample prefix: *my\_osmos\_output\_{jobId}\_*\
   Output: *\<user base path>/my\_osmos\_output\_\<ACTUAL JOB\_ID HERE>\_chunk-\<chunk num>-\<UUID>.\<file extension>*
4. File includes datetime specifiers and job\_id in the prefix

   Sample prefix: *{jobId}\_%F\_%T\_*\
   Output: *\<user base path>/\<ACTUAL JOB\_ID HERE>\_\<YYYY-MM-DD>\_\<HH:mm:ss>*\_chunk-\<chunk num>-\<UUID>.\<file extension>

## Connector Options

The connector can be deleted, edited and duplicated.

Duplication

To save time, the connector can be duplicated.  This new connector needs to be named and can be edited, as needed.

<figure><img src="/files/4qGT7zT0zIKFdDWaqOYd" alt="" width="563"><figcaption></figcaption></figure>


---

# 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.osmos.io/destination-connectors/google-drive-connector.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.
