Google Drive

The Google Drive component is a data component that allows users to connect to, and read files and folders within an existing Google Drive. It can carry out the following tasks:

#Release Stage

Alpha

#Configuration

The component definition and tasks are defined in the definition.json and tasks.json files respectively.

#Setup

In order to communicate with Google, the following connection details need to be provided. You may specify them directly in a pipeline recipe as key-value pairs within the component's setup block, or you can create a Connection from the Integration Settings page and reference the whole setup as setup: ${connection.<my-connection-id>}.

FieldField IDTypeNote
Refresh Tokenrefresh-tokenstringRefresh token for the Google Drive API. For more information about how to create tokens, please refer to the Google Drive API documentation and OAuth 2.0 documentation.

#Supported Tasks

#Read File

Read a file content and metadata from Google Drive.

InputIDTypeDescription
Task ID (required)taskstringTASK_READ_FILE
File ID (required)shared-linkstringShared link of the file. You can get the shared link by right-clicking on the file and selecting Copy link.
OutputIDTypeDescription
FilefileobjectFile in Google Drive.
Output Objects in Read File

File

FieldField IDTypeNote
ContentcontentstringBase64 encoded content of the binary file without the data:[MIME_TYPE];base64, prefix. Google Sheets will be exported as CSV, Google Docs as PDF, and Google Slides as PDF. If the file is not a Google file, the content will be the same as the original file.
Created timecreated-timestringTime when the file was created. Format: YYYY-MM-DDTHH:MM:SSZ.
IDidstringUnique ID of the file.
MD5 checksummd5-checksumstringMD5 checksum of the file. This reflects every change made to the file on the server, even those not visible to the user.
MIME typemime-typestringMIME type of the file. For example, application/pdf, text/csv, image/jpeg, etc.
Modified timemodified-timestringTime when the file was last modified. Format: YYYY-MM-DDTHH:MM:SSZ.
NamenamestringName of the file. The file extension will be added automatically based on the exported MIME type. For example, Google Sheets will be exported as CSV, Google Docs as PDF, and Google Slides as PDF. If the file is a Google Sheet and the name is MySheet, the exported file will be MySheet.csv. If the file is not a Google file, the name will be used as is.
SizesizeintegerSize of the file in bytes.
VersionversionintegerVersion of the file in Google Drive.
Web Content Linkweb-content-linkstringLink for downloading the content of the file in a browser.
Web View Linkweb-view-linkstringLink for opening the file in a relevant Google editor or viewer in a browser. Usually, web view link is same as shared link.

#Read Folder

Read metadata and content of files under the specified folder in Google Drive.

InputIDTypeDescription
Task ID (required)taskstringTASK_READ_FOLDER
File ID (required)shared-linkstringShared link of the file. You can get the shared link by right-clicking on the file and selecting Copy link.
Read Contentread-contentbooleanWhether to read the content of the files under the folder.
OutputIDTypeDescription
Filesfilesarray[object]List of files under the specified folder.
Output Objects in Read Folder

Files

FieldField IDTypeNote
ContentcontentstringBase64 encoded content of the binary file without the data:[MIME_TYPE];base64, prefix. Google Sheets will be exported as CSV, Google Docs as PDF, and Google Slides as PDF. If the file is not a Google file, the content will be the same as the original file.
Created timecreated-timestringTime when the file was created. Format: YYYY-MM-DDTHH:MM:SSZ.
IDidstringUnique ID of the file.
MD5 checksummd5-checksumstringMD5 checksum of the file. This reflects every change made to the file on the server, even those not visible to the user.
MIME typemime-typestringMIME type of the file. For example, application/pdf, text/csv, image/jpeg, etc.
Modified timemodified-timestringTime when the file was last modified. Format: YYYY-MM-DDTHH:MM:SSZ.
NamenamestringName of the file. The file extension will be added automatically based on the exported MIME type. For example, Google Sheets will be exported as CSV, Google Docs as PDF, and Google Slides as PDF. If the file is a Google Sheet and the name is MySheet, the exported file will be MySheet.csv. If the file is not a Google file, the name will be used as is.
SizesizeintegerSize of the file in bytes.
VersionversionintegerVersion of the file in Google Drive.
Web Content Linkweb-content-linkstringLink for downloading the content of the file in a browser.
Web View Linkweb-view-linkstringLink for opening the file in a relevant Google editor or viewer in a browser. Usually, web view link is same as shared link.