> For the complete documentation index, see [llms.txt](https://cgps.gitbook.io/data-flo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cgps.gitbook.io/data-flo/reference-guide/export-file-to-google-drive.md).

# 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.
