Google Drive
Learn how to use Google Drive Connector in DBSync Cloud Workflow
Introduction
The Google Drive Connector for DBSync Cloud Workflow enables seamless integration between Google Drive and your business workflows. This guide will help you set up, configure, and effectively use the Google Drive Connector to automate your file management tasks within the DBSync platform.
Prerequisites
A valid DBSync Cloud Workflow account.
Google Drive account with API access enabled.
Permissions to configure connectors in DBSync.
Setting Up the Google Drive Connector
Enable the Google Drive API
Go to the Google Cloud Console.
Create a new project or select an existing one.
Navigate to APIs & Services > Library.
Search for Google Drive API and enable it.
Create OAuth 2.0 credentials under APIs & Services > Credentials.
Set up the redirect URI according to DBSync’s integration requirements.
Configure the Google Drive Connector in DBSync
Log in to your DBSync Cloud Workflow dashboard.
Navigate to Apps in the left navigation bar.
From the list of available connectors, select Google Drive or click Add App under the Google Drive icon.
Click Login to Google Drive (OAuth) and enter your Google Drive credentials to complete the authentication.
After completing the authentication process, click Test Connection to validate the integration.
Basic Operations with the Google Drive Connector
Once connected, you can perform various file management tasks, such as uploading, downloading, or syncing files. Below are common use cases and their configuration details.
Use Case 1: Upload a File to Google Drive
Create a new Workflow in DBSync.
Add an Action Step and select Google Drive Connector.
Configure the action as Upload File.
File Path: Specify the file path in your source system.
Drive Folder ID: Provide the destination folder ID in Google Drive.
Save and test the action.
Use Case 2: Download a File from Google Drive
Add an Action Step with the Google Drive Connector.
Select the action as Download File.
File ID: Enter the ID of the file you wish to download.
Destination Path: Set the path where the file will be saved.
Save, test, and run the workflow.
Available Operations
Download File
This operation allows users to download files from the connected Google Drive account.
Read From (File/Folder Path)
Filepath: Enter a fixed file path.
Data-stream-variable: Click the Fx icon to choose a dynamic variable that retrieves the file path from previous actions, e.g., a file path returned from a QUERY operation in Salesforce.
Regular expression: Input a pattern, such as
r'.*\.txt$
, to download matching files.
File Content: The content of downloaded files is stored in a generated variable, which can be renamed as needed. This variable is automatically added to the data stream for further processing.
Properties for Download File Operation
The properties associated with this operation ensure that downloaded files are stored for further processing within the workflow.
Upload/Write File
This operation enables users to upload or write files to the selected Google Drive connection.
Operation: From the dropdown, choose Write.
Write To (File/Folder Path)
Filepath: Enter a static file path.
Data-stream-variable: Use the Fx icon to select a data stream variable for a dynamic file path.
Regular expression: Define a pattern, like
r'.*\.txt$
, for the target file.
File Name [Input Text]
Input a file name or drag and drop a variable from the data stream.
By default, the variable
$file-name
retains the source filename but can be edited as needed.
File Content [Input Text]
Choose the file content variable from the Fx dropdown.
Properties for Upload/Write File Operation
If File Name Exists [Dropdown]:
Skip: Skips the upload if the file name already exists.
Override: Replaces the existing file with the new one.
Batch-size [Dropdown]: Choose the batch size for the operation.
Options: 10, 50, 100, 1000.
Move/Rename File Operation
This operation allows users to move or rename files within the connected Google Drive account.
Select App [App Dropdown]: Choose the relevant app.
Operation: Select ‘Move/Rename File’.
Source File Path [Dropdown with editable input text]: Specify the file path to be moved or renamed.
Destination File Path [Dropdown with editable input text]: Enter the target path for the file.
Advanced Configuration
Custom Search Queries
You can use search parameters to filter files and folders in Google Drive. For example:
Search for a specific file type: mimeType='application/pdf'
Search by file name: name contains 'Report'
Error Handling
Implement error handling using the following steps:
Add a Conditional Step post-action to handle failed uploads or downloads.
Configure custom alerts or retries based on your workflow needs.
Security Best Practices
Restrict Access: Limit the scope of the Google Drive API to only the permissions necessary.
Monitor OAuth Tokens: Regularly rotate OAuth credentials and monitor for any unusual access.
Data Encryption: Use secure methods for data storage and retrieval.
Troubleshooting
Common Issues
Authentication Failure: Verify that the Client ID, Client Secret, and redirect URI are correctly configured.
File Not Found: Ensure the File ID or path provided is correct.
Access Denied: Check that the Google Drive API has the necessary permissions.
Last updated