# export-file-to-google-drive

## Description

<mark style="color:purple;">`export-file-to-google-drive`</mark> *adaptor is used to export a file to an existing folder in Google Drive*.

The folder should be shared with <mark style="color:blue;"><data-flo@data-flo.iam.gserviceaccount.com></mark> and given edit permission. This adaptor can be used to create a new file, or update an existing file in Google Drive

## Inputs

**`file`**\
Type: `file`\
Required: Yes\
The file to be exported.

**`file url`**\
Type: `text`\
Required: No\
The URL of an existing file on Google Drive to be updated. Leave empty to create a new file.

**`folder url`**\
Type: `text`\
Required: No\
The URL of the destination folder on Google Drive. Leave empty when updating a file.

**`output file name`**\
Type: `text`\
Required: No\
The name of the file to be on Google Drive.

## Outputs

**`url`**\
Type: `text`\
The Google Drive URL of the exported file.

**`id`**\
Type: `text`\
The Google Drive ID of the exported file.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`file:` example.txt

`file url:` *null (empty)*

`folder url:` <https://drive.google.com/drive/folders/123456?usp=sharing>

`output file name:` *null (empty)*

#### Outputs:

`url:` <https://drive.google.com/file/d/7891011>

`id:` 7891011

-> Exported the file example.txt to a goole drive folder.

### Example 2: Update an existing file.

#### Inputs:

`file:` example.txt

`file url:` <https://drive.google.com/file/d/7891011/view?usp=sharing>

`folder url:` *null (empty)*

`output file name:` test-example.txt

#### Outputs:

`url:` <https://drive.google.com/file/d/7891011>

`id:` 7891011

-> Overwrote the file example.txt on google drive and renamed it to test-example.txt.


---

# 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://cgps.gitbook.io/data-flo/reference-guide/export-file-to-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.
