GyanSys Logo (White)
Posted June 28, 2017

Integrating Salesforce and Google Drive Using Files Connect

Companies are getting increasingly reliant on applications such as Salesforce.com and Google Drive. The ability to share information between these applications enables streamlining business processes. All that is needed is minor customization within Salesforce, without the need for any API and complex code.

The introduction of Salesforce Files Connect has made the process of exposing Google Drive file data to Salesforce users much simpler. Previously, this required accessing data via Google web services APIs. Files Connect provides connectors for Google Drive. Once set up and configured, external data sources can be created to allow employees to access data from Google Drive in Salesforce.

What is Files Connect?

As the name implies, the most obvious use of Files Connect is the ability to access documents stored in Google Drive from within Salesforce. For example, a proposal document that resides in Google Drive can be attached to a lead that resides in Salesforce.

Files Connect can be set up in either Copy Mode or Reference Mode.

  • Copy Mode stores a copy of the Google Drive document in Salesforce. If files are shared with a Chatter group, all group members can access the files, even if they lack access to the document in Google Drive.
  • In Reference Mode, a copy of the file is not stored in Salesforce and there is simply a reference to the document in Google Drive. Any access to the file in Salesforce will require that the user have access to the file in Google Drive.

The Custom Properties of Google Drive can even be included in Search, SOQL, and SOSL Queries, so federated searches can query both Google Drive and Salesforce simultaneously from any device. Google Drive documents attached to social feeds, groups or records will be included in Salesforce search results.

7 Steps for Integrating Salesforce and Google Drive

The process starts with enabling Files connect for the Salesforce instance with a result that culminates in accessing Google Drive in Salesforce. It is easy to establish and configure the connection.

Step 1: Enabling Salesforce Files Connect

  • Go to Build > Customize > Salesforce Files > Settings > Files Connect. Or if you are lazy like me, you can find Files Connect in the quick find bar.
  • From there click on Edit and Enable Files Connect.
  • In the File Sharing setting select Copy or Reference depending upon your business requirement as discussed above.

Step 2: User Access Permissions for Files Connect

The next step is to set up user permissions for Files Connect. If you use permission sets for managing user permissions, go to Permission Set > System Permissions > Edit, then Select Files Connect Cloud. Click Save.

Step 3: Creating an Auth Provider

Now we need to set up the auth provider.

Once you click save, you will be directed to an Auth Provider Detail screen. This screen will have necessary details like “Callback URL”. You would need it for the next steps.

Step 4: Configuration in Google Drive

Now it’s time to configure Google Drive.

  • Search URL https://console.developers.google.com/project in Google.
  • Create New Project.
  • Enable API Google Drive API, Google App Marketplace SDK for the newly created project.
  • Create a Product in OAuth consent screen before creating Client ID in the credential.
  • Create Client ID in Credential, select Web Application, and put Callback URL obtained in step 3 in Authorized redirect URLs.
  • Click Create, which will lead you to Client ID and Client Secret. Copy the Client ID and Client Secret which you will need for the next steps.

Step 5: Reconfiguring Auth Provider

  • Put the Client ID and Client Secret obtained in Step 4 in Consumer Key and Consumer Secret.

Step 6: Creating External Data Source

  • The next step is to create an external data source in Salesforce.
  • Go to Setup->Build->Develop->External Data Source
  • Click on New External Data Source. You can use any name and label you like but it’s easier if you use similar names to authentication provider and other apps.
  • In Type Select Files Connect: Google Drive.
  • Identity Type is Per User. Authentication Protocol is OAuth 2.0
  • In Authentication Provider, click on lookup. Select the Authentication Provider that we just created in earlier steps.
  • Click Save.

Now that we have created the external data source, we have to enable it in permission set.

Step 7: Configuring Permission Set

  • Go to Permission set->External Data Source->Edit
  • Select and add the newly created data source to the Enabled External Data Source section.
  • Click Save.

After going through and customizing all of those, it's time to test it. Select Files Tab > External Files > Google Drive. Now you can access data from Google Drive in Salesforce.

Limitations

Here are some limitations of Files Connect –

  • You cannot upload files directly from Salesforce to Google Drive using Files Connect. You can only access and download it.
  • Some limitations of Google Drive API.
    • Requests per day 1,000,000,000
    • Requests per 100 seconds per user 1,000
    • Requests per 100 seconds 10,000

Concluding Remarks

All things considered, this is a very easy and reliable integration method. This method can be used to connect other products like Google Apps, SharePoint App, OneDrive, etc.


Find out how Tate & Lyle uses the Force.com platform to focus more on their customer instead of their disparate data systems.

For more information related to Salesforce Application Development, contact us at info@gyansys.com

Other Posts You May Enjoy: