Google Drive Kit
Google Drive Kit lets you search for, read, and write files in your Google Drive. The components in this kit closely mirror the official Google Drive API.
Get File Content
Use the getFileContent component to retrieve the raw bytes of a regular file in Google Drive.
Tip
To read a Google Doc or Sheet, use the Export File component instead of the Get File Content. Google Workspace files do not use standard file formats, so it is not possible to read them without first converting them to a standard format like plain text, HTML or CSV.
Input ports
fileId: The ID of the Google Drive file whose content to retrieve. SeefileIdin the Google Drive API documentation.
Output ports
content: The bytes of the file.
Implementation
Export File
Use the exportFile component to convert a Google Workspace file like a Doc or Sheet to a standard format like text, HTML, or PDF.
Input ports
-
fileId: The ID of the Google Drive Workspace file to export. SeefileIdin the Google Drive API documentation. -
mimeType: MIME type of the format that the file should be converted to. SeemimeTypein the Google Drive API documentation.Google Docs can be converted to
text/plain,text/markdown,text/html,application/pdf, and more. Google Sheets can be converted totext/csv,application/pdf, and more.
Output ports
content: A string containing the bytes of the file. SeeResponse Bodyin the Google Drive API documentation.
Implementation
List files
Use the listFiles component to search for files in your Google Drive matching
certain criteria, such as type or parent folder.
Input ports
-
query: A Google Drive search query. See search files in the Google Drive API Documentation for details on the syntax.Examples:
- All images in a folder:
mimeType contains 'image/' and '<folder-id>' in parents
- All images in a folder:
Output ports
-
files: The array of files that matched. Seefilesin the Google Drive API Documentation. -
nextPageToken: If there are too many files to fit in one page, a token for the next page of files. SeenextPageTokenin the Google Drive API documentation. -
incompleteSearch: Whether the search process was incomplete. SeeincompleteSearchin the Google Drive API documentation.