# Google Drive

## Introduction

The Google Drive storage action in DBSync Cloud Workflow allows users to upload files such as CSVs, PDFs, XMLs, and other data formats directly to their connected Google Drive accounts as part of an automated integration flow. This action is particularly useful for archiving or sharing files.

This feature is useful when you need to:

* Back up data generated by your integration workflows.
* Transfer reports or exported datasets to Google Drive.
* Archive processed documents for future reference or compliance.

By incorporating this action into your workflow, you can ensure that important files are securely stored in the cloud, easily accessible, and well-organized as part of your automated data processes.

## Use Cases

* Automatically store files in Google Drive after processing.
* Back up reports generated during workflow.
* Archive failed data records for later inspection.

### Use Case Scenario

**Scenario: Automated Invoice Backup to Google Drive**

A company processes customer invoices daily using DBSync’s integration between their CRM and Accounting systems. As part of the post-processing step, they want to back up a CSV version of the day's processed invoices to a structured folder in Google Drive.

## Configuration Steps

#### Add Google Drive Storage Action to Workflow

1. Drag and drop the **Google Drive** storage action into your workflow.
2. Click **Configure** on the Google Drive action.
3. Click the dropdown in the **Google Drive Connector** field and select your Connector.
4. Select the required **Operation** from the list. (*Read*, *Write*, *Move/Rename*).

Based on the selected operation, define the storage parameters as follows.

#### Define Storage Parameters for Read Operation

1. **File Path:** Specify the Google Drive folder path where the file should be fetched from (for example, `/My Drive/Dummy Records.csv`)
2. **File Content:** All downloaded files will be stored in a variable. This name is auto generated, however user can also change if needed. This variable will be added to the datastream (Central fx) to process further.
3. **Preview:** It displays the list of files that you have selected.

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FGVgcVITqrJHW1sMln0tt%2Funknown.jpeg?alt=media&#x26;token=897382a1-6b33-4b21-932c-90cc7e89d329" alt=""><figcaption><p>Read from Google Drive</p></figcaption></figure>

#### Define Storage Parameters for Write operation

1. **File Path:** Specify the Google Drive folder path where the file should be copied (for example, */My Drive/invoices/*).
2. **File Name:** Define the name for the file to be saved. You can use dynamic variables like *$file\_name*, *$file\_last\_modified\_date,* and *$last\_success\_run*.

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FQWJaUHwE4V9BL9djXr5B%2Funknown.jpeg?alt=media&#x26;token=0a2212ae-bb92-4e13-8488-f54b471df382" alt=""><figcaption><p>Write to Google Drive</p></figcaption></figure>

3. **File Content:** Select the variable from the Fx dropdown to choose the file content.
4. **Properties**
   1. **If File Name Exists:**
      1. *Overwrite*: Select to overwrite files with the same name.
      2. *Skip*: Select to overwrite the file with the same name.
   2. **Batch size**: user can select the batch size of *10*, *50*, *100*, *1000* from the dropdown.

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FeLpXogBBU1M8wNbPMVQS%2Funknown.png?alt=media&#x26;token=98e83587-4a40-484c-9a65-0e2e927a31c1" alt=""><figcaption><p>Write to Google Drive - Properties</p></figcaption></figure>

#### Define Storage Parameters for Move/Rename Operation

This operation is provided to move the data from one file path to another. You can also rename the file while moving.

* **Source File Path:** Choose a file from the drop down list OR input a regular expression for a customized and dynamic pattern.
* **Destination File Path**: Choose a file from the drop down list OR input a regular expression for a customized and dynamic pattern.

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FXJiwmqPfTP6SkerfymPp%2Funknown.png?alt=media&#x26;token=1c080df3-5988-4373-ba5e-b6ad5fe28312" alt=""><figcaption></figcaption></figure>

## **Best Practices**

* Ensure OAuth scopes are correctly configured to allow file uploads.
* Use expressions to dynamically name folders and files for organized storage.
* Set clear error handling for upload failures (For example, notify via Webhooks or Email).

## **Troubleshooting**

* OAuth Expired: Reconnect your Google Drive account.
* File Not Uploading: Check folder permissions and file size limits.
* Incorrect Format: Ensure the content is properly encoded and MIME type is accurate.


---

# 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.mydbsync.com/cloud-workflow/2026_create-your-workflow/action/storage-actions/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.
