Actions19
Overview
This node operation lists files in Google Drive using a service account for authentication. It supports filtering files with a query string, limiting the number of results, sorting the results, and selecting specific fields to return. This is useful for automating file management tasks, such as retrieving a list of reports, documents, or any files stored in Google Drive, especially in scenarios where service account access is required for domain-wide delegation or automated workflows.
Use Case Examples
- List all files containing 'report' in their name, sorted by creation date descending.
- Retrieve up to 50 files with specific fields like id, name, and mimeType for further processing.
Properties
| Name | Meaning |
|---|---|
| Authentication | Choose authentication method: use saved credentials or enter manually. |
| Service Account Email | Service account email address from the service account JSON, required if manual authentication is selected. |
| Private Key | Private key from the service account JSON, required if manual authentication is selected. |
| Impersonate Email (Optional) | Email of the user to impersonate, requires domain-wide delegation, optional for manual authentication. |
| Options | Additional options to filter and control the list of files returned. |
Output
JSON
jsonid- The unique identifier of the file.name- The name of the file.mimeType- The MIME type of the file.createdTime- The creation timestamp of the file.modifiedTime- The last modification timestamp of the file.size- The size of the file in bytes.parents- Array of parent folder IDs the file belongs to.
Dependencies
- Google Drive API
- Google service account credentials
Troubleshooting
- Ensure the service account has the necessary permissions to access the Google Drive files.
- If using manual authentication, verify the service account email and private key are correctly entered and formatted.
- Check that the impersonate email is set only if domain-wide delegation is configured.
- Common errors include authentication failures due to invalid credentials or insufficient permissions, and query syntax errors in the filter string.
Links
- Google Drive API - Files: list - Official documentation for listing files using the Google Drive API.
- Google Cloud Service Accounts - Information about creating and managing Google Cloud service accounts.