Help Centre › Functions & Formulas
This article describes the RPA Google Drive functionality to list files.
For a full list of available functions, please read Google Drive functions.
Description
The Google Drive List files function lists all files in a folder or matching a query. Pagination is handled automatically to return all results.
Setting it up
To use the Google Drive List files function, follow these instructions:
{{popups:rpas/add:action=google-workspace-drive-list-files}}
Once on a process map:
- Navigate to the process where you would like to add the Google Drive List files function
- Click on the green button's drop-down (right side of the green button labelled "Process")
- On the menu that appears, click on the "+ Activity" item
- From here you can select the Google Drive List files option
- Click "Add" once you are done
Input parameters
| Parameter | Required | Type | Default | Description |
|---|---|---|---|---|
| Folder ID | No | Text | Entire Drive | Folder ID to list files from |
| Query filter | No | Text | - | Custom Drive API query filter (e.g. "mimeType = 'application/pdf'") |
| Variable | No | Text | - | State variable to store the list of file dictionaries |
Output variables
| Variable | Type | Description |
|---|---|---|
| Variable | List | List of file objects with id, name, mimeType, and size |
Errors
| Error | Description |
|---|---|
| Folder not found | The specified folder ID does not exist |
| Invalid query | The query filter syntax is invalid |
Tips
- Use the query filter for advanced filtering, e.g. "mimeType = 'application/pdf'" for PDF files only
- Without a folder ID, all files in the Drive are returned
- Use with a loop to process each file in the list