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 files data to Salesforce users much simpler. Previously, this required accessing data via Google web services APIs. Files Connect provides connectors for Google Drive. Once setup and configured, external data sources can be created to allow employees 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 setup in either Copy Mode or Reference Mode. Copy Mode actually 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.
Files Connect Architecture Overview
Steps for Integrating Salesforce and Google Drive
The process starts with enabling Files connect for the Salesforce instance with a result that culminates 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 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.
- Go to Quick Find in setup and find Auth. Provider. Once you are there click on “New”.
- Once there you would have to choose the “Provider Type”. Select OpenID Connect.
- Enter the Name and URLSuffix, and for now enter a dummy value for Consumer Key, Consumer Secret, Authorize Endpoint URL as https://accounts.google.com/o/oauth2/auth?access_type=offline&approval_prompt=force , Token Endpoint URL as https://accounts.google.com/o/oauth2/token and Default Scopes as “openid email profile https://www.googleapis.com/auth/drive”.
Once you click save, you would 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 newly created project.
- Create a Product in “OAuth consent screen” before creating “client ID” in credential.
- Create client ID in credential, select web application and put “Callback URL” obtained in step 3 in Authorized redirect URIs. Click ‘Create’ it will give ‘’Client Id” and “Client Secret”. Copy “Client Id” and “Client Secret”, you would need it for 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.
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 limitation 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
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.
Watch this space for my next post related to Salesforce Integration.
Find out how Tate & Lyle uses the Force.com platform to focus more on their customer instead of their disparate data systems.
- Integrating Salesforce and Google Drive Using Files Connect - June 28, 2017