Skip to content

Google Drive

Google Drive reads files stored in your Google Drive: one specific file or the documents in a folder, including its subfolders. It can return the text of the files, so an agent or a model can work with it, or the details of the files themselves, to pass them on to another component.

It reads Google documents, spreadsheets and presentations, PDFs, Word, Excel and PowerPoint files, CSV files, text files and images.

When to use it

  • Summarise the reports the team keeps in a shared Drive folder.
  • Load internal documentation into a knowledge base an agent can search.
  • Read the file or folder given by each item of a list, for example each customer’s folder.
  • Give an agent the ability to read Drive documents when it needs them.

Configuration

The component needs a Google Drive credential connected to the Google account where the files are. See Credentials.

FieldWhat it does
Credential (required)The Google Drive credential used to access the files.
Select fileThe specific file you want to read.
or Select folderThe folder you want to read. If you pick a folder, the folder is read instead of the file.
File TypeWhich files are read from a folder: all (every supported type), document (Google documents and spreadsheets), sheet (Google spreadsheets, Excel and CSV) or pdf (PDFs only). Default: all.
Data with fileConnect a list of data here to read a different file or folder for each item. The component takes its ID from the fields named in File Id Key and Folder Id Key and adds the text it reads to each item.

You must pick a file or a folder, or connect data to Data with file.

Advanced options

FieldWhat it does
Download File contentIn the Files output, when reading a folder, also downloads the content of each file. When off, the output returns only the details of each file.
File Id KeyWith Data with file, the name of the field that holds the file ID. Default: file_id.
Folder Id KeyWith Data with file, the name of the field that holds the folder ID. Default: folder_id.

Output

  • Data: the text of each file read, along with details such as its name and link. Connect it to an agent, a model or a document store.
  • Files: for each file, its ID, name, link, type and, if you asked for it, its content. It returns nothing when you use Data with file.

The component can also be used as a tool by an agent.

Example

A law firm keeps a Drive folder per client with their documents:

  1. Add Google Drive, pick the credential and, in or Select folder, the client’s folder.
  2. In File Type, pick pdf to read only the PDFs.
  3. Connect Data to an agent that prepares a summary of the case file.
  4. Save the summary to a document or email it.

Good practices

  • Use File Type to read only the files you care about in a folder.
  • Pick the most specific folder you can: all its subfolders are read too.
  • Turn on Download File content only if the next component needs the content of the files.