Skip to main content

Google Drive Integration

Google Drive is Google’s cloud storage service that allows users to store, synchronize, and share files. Frappe Framework integrates with the Google Drive Picker, allowing users to browse their Google Drive and attach files directly to documents without uploading them to the server.

Tip:

Google Drive integration is useful when your organization stores documents in Google Drive and wants to reference them directly from Frappe.

How It Works

Once configured, the Attach File dialog displays a Google Drive option. Users can authenticate with their Google account, browse their Drive, and attach a selected file to the current document.

The selected file remains in Google Drive. Frappe attaches a reference to the file instead of uploading a duplicate.

Configure Google Cloud Console

Before enabling Google Drive integration in Frappe, create the required credentials in the Google Cloud Console.

Step 1: Enable the Google Picker API

Create a Google Cloud project, enable the Google Picker API, and generate the required credentials.

Step 2: Create an API Key

Generate an API Key and configure the following restrictions:

  • Application Restrictions – HTTP Referrers
  • Website Restrictions – Add your Frappe site’s hostname
  • API Restrictions – Restrict the key to the Google Picker API

Step 3: Create an OAuth Client ID

Create an OAuth 2.0 Client ID using the following settings:

  • Application Type – Web Application
  • Authorized JavaScript Origins – Add your Frappe site’s hostname

After creation, note down the generated Client ID.

Step 4: Configure the OAuth Consent Screen

Configure the OAuth Consent Screen that users will see when accessing Google Drive for the first time.

Include the following permission scope:

https://www.googleapis.com/auth/drive.readonly

You will also need your project’s App ID (Project Number), which can be found under IAM & Admin → Settings.

Note:

The integration requires the App ID, Client ID, and API Key generated from your Google Cloud project.

Configure Google Settings in Frappe

After creating the required Google credentials, configure them in your Frappe instance.

  1. Open Google Settings.
  2. Enable the Google Settings option.
  3. Enable Google Drive Picker.
  4. Enter the App ID, Client ID, and API Key.
  5. Save the settings.
  6. Reload your browser.

Reloading the browser is required before the Google Drive option becomes available in the file attachment dialog.

Using Google Drive Picker

Step 1: Open the Attachment Dialog

Open any document and click Attach File from the sidebar.

If the integration is configured correctly, a Google Drive icon will be displayed.

Step 2: Sign In to Google

The first time you use the integration, authorize the Frappe application to access your Google Drive.

Step 3: Select a File

Browse your Google Drive, choose the required file, and confirm your selection.

Step 4: Attach the File

Click the confirmation button to attach the selected Google Drive file to the current document.

Best Practice:

Store large documents in Google Drive and attach them using the picker instead of uploading duplicate files into your Frappe site.

Summary

Google Drive integration enables users to:

  • Browse Google Drive directly from Frappe.
  • Attach Drive files to any document.
  • Authenticate securely using Google OAuth.
  • Keep documents stored in Google Drive while referencing them from Frappe.
Rating: 0 / 5 (0 votes)