How to connect Google Drive With Salesforce using Files Connect

 Hello Everyone,

My name is Akash Wadje . I'm Trailhead Ranger with 156+ Badges you can connect with me LinkedIn .

Today we will see how to connect Google Drive with Salesforce File using File Connect.

So Let's begin,

___________________________________________________________________________________

Step 01 :

In salesforce, Go to Setup > " Files Connect" and enable the checkbox to enable file connect in your org


Step 02 :

Go to Setup >  Permission Set > Create new permission set e.g. "File Connect Permission" > Under that permission set search "File Connect Cloud" click on it and check the checkbox.

Now Assign this permission set to user that you want to assign.
Click on "Manage Assignment" > and Add Assignment User that you want to add 

Step 03 :

Now, Go to https://console.cloud.google.com/ Create New project  give a name to Project 

e.g. "Test File Connector" click on save.

- In the project dashboard, click the menu icon in the upper left, and then click APIs & Services.

- In the API manager, go to the Library tab and search for "Google Drive API".

- In the search results, click "Google Drive API", and then click Enable API.

Step 04 :

- In the menu on the left, click Credentials.

Click on Create Credentials and select OAuth Client ID and follow following details 

( If You Face issue to create configure OAuth consent follow this link : https://youtu.be/TKnnrGU9MFw )

Application Type : Web Application

Name : __(as per your choice)__ e.g. Test 001

click on save. ( We will get back again here to insert JavaScript origin and Redirect Url )

You will get Client Id and Client Secrete note it. 


Step 05 :

Setup >  Search for "Auth. Providers" > and provide details as mentioned in image below :

>> Name — Enter the name you want to appear in Salesforce.

>> Consumer Key — Enter the client ID you copied when creating the Google project.

>> Consumer Secret — Enter the client secret you copied when creating the Google project.

>> Authorize Endpoint URL —Enter https://accounts.google.com/o/oauth2/auth?    access_type=offline&approval_prompt=force

>> Token Endpoint URL — Enter https://accounts.google.com/o/oauth2/token

>> Default Scopes — Enter openid email profile https://www.googleapis.com/auth/drive

After saving above Auth. Providers information copy "Test-Only Initialization URL" and "Callback URL" and then paste it into google credentials JavaScript origin and Redirect Url respectivly as shown in below :

Pic : Step 05 (02)

Pic : Step 5 (3)

Step 06 :

Go to Setup > Search for "External Data Source" create new 
Name : ----- e.g. "Google Drive test"
Type : Files Connect : Google Drive
Identity Type : Named Principal
Authentication Protocol : OAuth 2.0
Authentication Provider  : Google Drive2 (Select name of your Auth. Provider)
Scope :  openid email profile https://www.googleapis.com/auth/drive
Authentication Status : Authenticated as (enter Google Api Email id)


after saving allow google access after successful saving click on "Validate and Sync".
new External Object  will be created . e.g.. label "items_Google_Drive_test"

Note - You must have to click on "Validate and Sync" in order to get External Object

Step 07 :

Finally , Go to Setup > Tab > and create tab for these external object.

Now go to that new tab you will see all your drive files under that 

You will also able to see that files under "Files" object > Google Drive section will be created there.

Thank You....!!!!


If you have any doubts you can contact me .


Happy Learning...…..!!!!







Comments